|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp可以轻松地实现对页面内容的动态控制,根据不同的浏览者,显示不同的页面内容。而浏览者一点觉察不出来,就像为他专门制作的页面一样。使用各种各样的组件,asp可以完成无比强大的功能。喜好者|程序|购物车<%@Language=VBScript%>
<%Response.Expires=0%>
<%
写进COOKIE
Response.WriteRequest.Cookies("warebuycount")
subsetcookie(Aname,warenum,warename,price,warecount,pricelow)
Response.Cookies(Aname).domain=application("wareurl")wareurl代表域名
Response.Cookies(Aname).expires=date()+30COOKIE过时日期
Response.Cookies(Aname).path="/"
Response.Cookies(Aname).Secure=FALSE
Response.Cookies(Aname)("warenum")=warenum商品编号
Response.Cookies(Aname)("warename")=warename商品称号
Response.Cookies(Aname)("price")=price代价
Response.Cookies(Aname)("warecount")=warecount购置的数目
Response.Cookies(Aname)("pricelow")=pricelow会员代价
endsub
subsetcount(warebuycount)用于盘算客户购置的商种类类
Response.Cookies("warebuycount").domain=application("wareurl")
Response.Cookies("warebuycount").expires=date()+30
Response.Cookies("warebuycount").path="/"
Response.Cookies("warebuycount").secure=false
Response.Cookies("warebuycount")=warebuycount
endsub
写进COOKIES
subsetcookies(warenum,warename,price,warecount,pricelow,warebuycount)
setcookie"warenum"+Cstr(warebuycount),warenum,warename,price,warecount,pricelow
endsub
subdelcookies(delwarenum)
warebuycount=Request("warebuycount")-1
whileCint(delwarenum)<=Cint(warebuycount)
setcookiesRequest.Cookies("warenum"+Cstr(delwarenum+1))("warenum"),Request.Cookies("warenum"+Cstr(delwarenum+1))("warename"),Request.Cookies("warenum"+Cstr(delwarenum+1))("price"),Request.Cookies("warenum"+Cstr(delwarenum+1))("warecount"),Request.Cookies("warenum"+Cstr(delwarenum+1))("pricelow"),delwarenum
delwarenum=delwarenum+1
wend
setcountwarebuycount
endsub
warenum=Request.QueryString("warenum")从GET前往的商品编号,固然,这个商品也必定要存在于你的商品表中
warename=Request.QueryString("warename")从GET前往的商品称号
price=Request.querystring("price")代价
warecount=Request.QueryString("warecount")购置数目
pricelow=Request.QueryString("pricelow")会员代价
setcount4
warebuycount=Request.Cookies("warebuycount")
Response.Writewarebuycount
ifRequest.ServerVariables("REQUEST_METHOD")="POST"then
dum=request("del")
dimdelnum
delnum=split(dum,",")
T1=1
warebuycount=Request.Cookies("warebuycount")
whileT1<=Cint(warebuycount)
tm=request("warenum"+Cstr(T1))
rm="warenum"+Cstr(T1)
nomodi=false
iftm=""then
tm=0
endif
ifinstr(1,Cstr(tm),".")ortm=0then
nomodi=true
else
setcookiesRequest.Cookies("warenum"+Cstr(T1))("warenum"),Request.Cookies("warenum"+Cstr(T1))("warename"),Request.Cookies("warenum"+Cstr(T1))("price"),tm,Request.Cookies("warenum"+Cstr(T1))("pricelow"),T1
endif
T1=T1+1
wend
ifdum""then
Cwarenum=0
whileCwarenum<=ubound(delnum)
</p>ASP脚本是采用明文(plaintext)方式来编写的。 |
|