一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

这个是我以前用去年用ASP写的一个购物车主体,已经功过测试,运行良好,希望能给ASP的爱好者带来益处

时间:2022-07-02 23:22:15 编辑:袖梨 来源:一聚教程网

<%@ Language=VBScript %>
<%Response.Expires=0%>
<%
'写入COOKIE
'Response.Write Request.Cookies("warebuycount")
sub setcookie(Aname,warenum,warename,price,warecount,pricelow)
    Response.Cookies(Aname).domain=application("wareurl") 'wareurl代表域名
    Response.Cookies(Aname).expires=date()+30 'COOKIE过期日期
    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 '会员价格
end sub
sub setcount(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
end sub
'写入COOKIES
sub setcookies(warenum,warename,price,warecount,pricelow,warebuycount)
    setcookie "warenum"+Cstr(warebuycount),warenum,warename,price,warecount,pricelow
end sub
sub delcookies(delwarenum)
    warebuycount=Request("warebuycount")-1
    while Cint(delwarenum)<=Cint(warebuycount)
        setcookies Request.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

热门栏目