关于cookies的使用问题

seav 2009-03-17 01:10:39
<%
'增加会员的积分
Sub Per_AddJifen(id)
dim inputid,pid
pid=id
pid=replace(trim(pid),"'","")
pid=replace(trim(pid)," ","")
if isnull(pid) then pid="" end if

if pid<>"" then
inputid=Request.cookies("inputid")
if inputid="" then
conn.execute("update member set jifen=jifen+1 where id="&pid)
Response.Cookies("inputid")=pid
Response.Cookies("inputid").Expires=date()+30
response.Write("有执行!")
end if
end if

End sub

Call Per_AddJifen(request("pid"))

%>


以上asp程序,功能是当访问者通过http://www.xxxx.com/index.asp?pid=1233 这样访问网站,在index.asp加入以上代码,相应会员号1233就会增加一个积分,使用cookies记录30天内是否已访问过.
第一次访问http://www.xxxx.com/index.asp?pid=1233 ,会员1233积分可以增加1分.网页也显示"有执行!"
关闭IE,在没有清理cookies的情况下,再访问http://www.xxxx.com/index.asp?pid=1244 ,会员1244积分可以增加1分,但是网页没有显示"有执行!",为什么呢?



...全文
99 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
seav 2009-03-18
  • 打赏
  • 举报
回复
up
seav 2009-03-17
  • 打赏
  • 举报
回复
up

28,409

社区成员

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

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