关于cookie的问题!

tangbow 2003-10-16 10:44:13
我写了一个购物车,
在windows2000下,没有问题。
可是在98下,有时候会出现,产品不能添加,删除的情况!
大家帮忙看看,会是什么原因。
...全文
27 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
编程最光荣 2003-11-20
  • 打赏
  • 举报
回复
一个笨办法,进入网站首页之前新建一页,专门用于清空所有用到的cookie(该页也可以用来测试用户是否支持cookie!),之后在转向首页!
tangbow 2003-11-20
  • 打赏
  • 举报
回复
大家给看看呀
tangbow 2003-11-19
  • 打赏
  • 举报
回复
大家帮忙看看呀!
tangbow 2003-11-19
  • 打赏
  • 举报
回复
源码如下:
大家帮忙!
--------------------------------

<%'购物车函数

dim product()
redim product(30)

function shopping(product_id,p_num,id)
judge=0
product_all=request.cookies("shopping")
if product_all<>"" then
newchars=split(product_all,"|")
i=0
do while not newchars(i)=""


product(i)= newchars(i)
product_l=product(i)
product_n=split(product_l,",")
'productid=product_n(0)
' product_num=product_n(1)
'删除商品
if id=0 then
if product_n(0) <> product_id then
shopping=shopping&product(i)&"|"
'response.cookies("shopping")=shopping
end if
end if

if id=1 then
if product_n(0) = product_id then
if product_n(1)="" then'产品数量
product_n(1)=1
end if
p_num1 =0 + formatnumber(product_n(1)) + formatnumber(p_num)
judge=1
shopping=shopping&product_id&","&p_num1&"|"
'response.cookies("shopping")=shopping'将购物加入购物车
else
shopping=shopping&product(i)&"|"

end if
end if
i=i+1
loop

response.cookies("shopping")=shopping
if judge<>1 and id=1 then
response.cookies("shopping")=request.cookies("shopping")&product_id&","&p_num&"|"
end if



else

response.cookies("shopping")=product_id&","&p_num&"|"
end if
end function
%>
YUFEI72 2003-11-06
  • 打赏
  • 举报
回复
源码。。。。。
tangbow 2003-11-06
  • 打赏
  • 举报
回复
没人知道?
tangbow 2003-10-17
  • 打赏
  • 举报
回复
有没有人知道呀?
tangbow 2003-10-16
  • 打赏
  • 举报
回复
可是98下不是总不行,一般可以,偶尔会出现以上情况,只有清空cookie才可以恢复正常!
pp4u 2003-10-16
  • 打赏
  • 举报
回复
会不会98下没有安装组件。

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧