- UID
- 26457
- 斋米
-
- 斋豆
-
- 回帖
- 0
- 积分
- 8553
- 在线时间
- 小时
- 注册时间
- 2012-3-1
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2013-11-1 23:10:08
|
显示全部楼层
本帖最后由 风继续吹 于 2013-11-1 23:11 编辑
; f* c$ L/ D/ W8 Q7 A$ O4 G0 R7 q0 K. l
9 N4 { E t7 t8 B* \1 y, R- M
我是这么写的2 H% c* t( e6 }) z7 D9 ?0 y
<%
9 @5 e- [7 ]8 v3 Rsub historyid(id,history)
5 i0 R; M* A; O7 t if len(history)=0 then2 E# C6 z8 E/ t* Q# w8 K' ~
history=id4 \) `/ `9 X- r; l3 \& B2 G
elseif instr(history,id)<=0 then$ i$ ?6 e$ x7 x
history=history&","&id
5 M: d& @% p, X& X9 X. @% W I# p end if; e& d8 o" k1 ]
end sub
6 ]4 y& S* ~% I& {historyid request("id"),request.cookies("history")6 t3 M7 R( c" D" [5 Y& x/ ~- R
response.cookies("history")=history% X) D) D7 \) h' g& W p
%>
7 u6 p/ V5 x9 `% I) r如果浏览的第一个页面的ID是145,那么response.cookies("history")=145
5 a/ R. G; x7 P0 ^2 { a如果浏览的第二个页面得ID是45,那么response.cookies("history")还是=1451 [' d, H7 {5 g6 Q7 r7 i
5 l. Z) ~" L4 i5 P8 M X
如果先浏览45再浏览145那个,那么response.cookies("history")=45,145* Q+ m6 w+ q: O4 F$ ~
5 z1 n; ]' T+ W% K就是if instr(history,id)<=0 then把两个分不开。
9 t7 ]: O. B0 }' Q+ y0 R+ M2 y! n3 }, m$ L& d* Y
" c# N8 V& ?) G: A0 n1 A
$ |4 A9 v# e6 ~6 z* ?
后面我直接换成存数据库jilu_biao里45一条记录,145一条记录,其余的分别都一条记录,然后再循环输出就可以解决$ [8 r5 Z7 I6 z# g3 U
\9 {. ?; C7 X* ^( z2 W" p
<%
( V$ Q( U8 o- }% T/ eset rs=server.createobject("adodb.recordset")
0 L5 |7 g7 ]' S$ d1 z2 D/ urs.open "select * from jilu_biao where userid="&userid,conn,1,1
7 V. y% o( S. p' b4 @2 Vif not(rs.eof and rs.bof) then k. w5 P- @* L i2 ?' o# g* x* d, R
set s=server.createobject("adodb.recordset")% S! S1 O" D, k2 C% x5 l
do while not rs.eof/ Q7 r' L! m0 X+ T
s.open "select * from data_biao where id="&rs("id"),conn,1,1& r! I, x; |: w$ s" @2 e; e
" a( d# q9 A% \: m, C( M
'以下省略............+ R0 }* S) s" P1 r- T6 T7 b0 u8 Z
( F: U' r) {) c/ J1 @' `- A3 d%> |
|