- UID
- 26457
- 斋米
-
- 斋豆
-
- 回帖
- 0
- 积分
- 8553
- 在线时间
- 小时
- 注册时间
- 2012-3-1
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2013-11-1 23:10:08
|
显示全部楼层
本帖最后由 风继续吹 于 2013-11-1 23:11 编辑 , O+ T( {& ?+ W4 f6 j
$ ]) z+ W& i% O! _" p. @
+ e: X' E$ v* e% U我是这么写的
0 {( z% ^' {4 P! g! V; V: P<%
/ ~1 F3 s9 s; y# c7 |9 tsub historyid(id,history)
6 Z/ n2 r% v: \% ^3 E8 @3 ^/ S if len(history)=0 then
# Y/ Y* ~) a O% l. }& ^! W, C history=id
. I0 B) \4 C( O7 | elseif instr(history,id)<=0 then1 Z4 r5 ?9 h x% Y; C
history=history&","&id
) s! r& `2 P( z Y C end if
0 b ^+ L, k) ?2 Pend sub* N* ?1 B3 P7 l" e% C; Y* W
historyid request("id"),request.cookies("history")
6 C- \ V! b+ D2 f: q6 {response.cookies("history")=history
5 @8 k8 j7 T1 t/ V5 F# J! z%>! K5 A1 i3 H* C0 N
如果浏览的第一个页面的ID是145,那么response.cookies("history")=1456 E7 J/ r7 m8 P& Q; U0 f9 l W
如果浏览的第二个页面得ID是45,那么response.cookies("history")还是=145& e: X+ J# E0 G* J, p4 z$ B
- L$ w% n! M& `9 \* R% _5 O
如果先浏览45再浏览145那个,那么response.cookies("history")=45,145, l+ m) P; R& d* r! `- [" `7 `
* B$ c9 Q# i' K- l- m就是if instr(history,id)<=0 then把两个分不开。' K$ p, _/ i8 [
/ A1 l9 B5 G7 P, _7 z* R' ~" x6 Q" s& n8 {$ J/ B1 C
- T1 E9 c3 _' ~
后面我直接换成存数据库jilu_biao里45一条记录,145一条记录,其余的分别都一条记录,然后再循环输出就可以解决
/ \* ~, L4 a4 x) f: K! b) q7 }8 u* ?5 m3 _
<%! w9 x$ [5 K1 J0 F; d- ~
set rs=server.createobject("adodb.recordset")
( l0 A1 a9 i8 b- U- H7 |rs.open "select * from jilu_biao where userid="&userid,conn,1,1
" r, m+ Q5 {4 ?: hif not(rs.eof and rs.bof) then
; W2 d5 r+ r) l3 B& _4 [ set s=server.createobject("adodb.recordset")
% b- q6 c: y8 Z6 ]( _ do while not rs.eof
% |9 v+ Z1 S6 w* T/ N s.open "select * from data_biao where id="&rs("id"),conn,1,1
' S4 {0 n* e' }- s# p3 s+ u' y# [; d5 s N7 L* X# O
'以下省略............
6 N S+ w4 x1 {, L4 X, `2 O5 Q2 R/ l. `1 e7 }2 v' B/ D3 R) F
%> |
|