Fans | program | Shopping cart <%@ language=vbscript%>
<%Response.Expires=0%>
<%
' Write Cookie
' Response.Write request.cookies ("Warebuycount")
Sub Setcookie (Aname,warenum,warename,price,warecount,pricelow)
Response.Cookies (Aname). Domain=application ("Wareurl") ' Wareurl represent domain name
Response.Cookies (Aname). Expires=date () +30 ' cookie expiration date
Response.Cookies (aname). Path= "/"
Response.Cookies (Aname). Secure = FALSE
Response.Cookies (Aname) ("Warenum") =warenum ' commodity number
Response.Cookies (Aname) ("Warename") =warename ' product name
Response.Cookies (Aname) ("Price") =price ' prices
Response.Cookies (Aname) ("Warecount") =warecount ' quantity purchased
Response.Cookies (Aname) ("Pricelow") =pricelow ' member Price
End Sub
Sub SetCount (Warebuycount) ' is used to calculate the types of goods purchased by customers
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
' Write 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
Delwarenum=delwarenum+1
Wend
SetCount Warebuycount
End Sub
Warenum=request.querystring ("Warenum") ' The item number returned from GET, of course, this product must also exist in your commodity list
Warename=request.querystring ("Warename") ' The name of the product returned from get
Price=request.querystring ("price") ' Prices
Warecount=request.querystring ("Warecount") ' Purchase quantity
Pricelow=request.querystring ("Pricelow") ' Member price
' SetCount 4
Warebuycount=request.cookies ("Warebuycount")
' Response.Write Warebuycount
If Request.ServerVariables ("request_method") = "POST" Then
Dum=request ("Del")
Dim delnum
Delnum=split (Dum, ",")
T1=1
Warebuycount=request.cookies ("Warebuycount")
While T1<=cint (Warebuycount)
Tm=request ("Warenum" +cstr (T1))
Rm= "Warenum" +cstr (T1)
Nomodi=false
If tm= "" Then
Tm=0
End If
If InStr (1,cstr (tm), ".") or tm=0 Then
Nomodi=true
Else
Setcookies request.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
End If
T1=t1+1
Wend
If dum<> "" Then
Cwarenum=0
While Cwarenum<=ubound (Delnum)