- UID
- 26457
- 斋米
-
- 斋豆
-
- 回帖
- 0
- 积分
- 8553
- 在线时间
- 小时
- 注册时间
- 2012-3-1
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2013-11-1 23:10:08
|
显示全部楼层
本帖最后由 风继续吹 于 2013-11-1 23:11 编辑
! [/ f+ `6 J" L% c; u& F( a3 X" e3 s& _
- l9 `2 d2 }& [- r/ r- y
我是这么写的% ?. [4 T0 Q5 e8 L* q. s
<% f4 `) B! a8 W8 I2 @
sub historyid(id,history)
3 R5 M4 A3 m+ Q) L; M2 v if len(history)=0 then) x- S4 V2 B; b, ~, f; O S) I4 I/ D
history=id
3 ^9 ^6 l+ W* n" {4 s elseif instr(history,id)<=0 then
2 g* r; i3 M, e& Q9 I* i history=history&","&id% L1 G7 k/ ]: l j& b
end if
6 y3 C' w5 r3 j6 K; Fend sub
" `9 T* c8 a8 ~historyid request("id"),request.cookies("history")1 ^. g( c& ?8 l) M& s0 s
response.cookies("history")=history
9 j6 Z2 B- x2 Y% E%>
) g3 N5 u. s3 x3 q) @$ h2 E如果浏览的第一个页面的ID是145,那么response.cookies("history")=145
( Z( v- [8 ~# P; H5 ]1 w如果浏览的第二个页面得ID是45,那么response.cookies("history")还是=145: C6 x! l% Z. t: r: U0 J* K C$ W
" F/ q4 r1 G9 ^+ k8 N5 \5 l: u如果先浏览45再浏览145那个,那么response.cookies("history")=45,145
0 }- H! C8 S& H" w& s3 o* D" Q6 E5 j' y9 z5 c
就是if instr(history,id)<=0 then把两个分不开。
% _+ P# j4 _( t% a
2 W0 j0 S8 I2 c7 {: Z* t
7 o8 l- n2 |& g; i7 X# X" D6 E+ }+ T4 W) r1 }# c
后面我直接换成存数据库jilu_biao里45一条记录,145一条记录,其余的分别都一条记录,然后再循环输出就可以解决
, n0 s/ N& @7 a% f2 ]. @
" z. S4 N) R( f( c0 i/ r& Q, I<%
- h1 Z1 j+ B Z- gset rs=server.createobject("adodb.recordset")% `5 Z& @% ^* G! {) a
rs.open "select * from jilu_biao where userid="&userid,conn,1,19 R6 a& c: v, X7 \& A
if not(rs.eof and rs.bof) then
6 O* n3 R( `$ {/ D2 d0 { set s=server.createobject("adodb.recordset")% H S% ^2 v# j, h) C
do while not rs.eof
1 b' b# B' ?* _; H" t6 G4 G) t s.open "select * from data_biao where id="&rs("id"),conn,1,19 v& N! P5 [) g, |
4 _8 w$ A- Z' V/ w# m2 C4 H '以下省略............
, {. R+ b9 f- `7 \ U1 ^5 z6 H# j$ n" g1 I* c6 n/ m
%> |
|