Shopping Cart Example (go) (Process page)

Source: Internet
Author: User
Tags chr trim
Shopping Cart | Page <!--put2bag.asp-->

<%@ Language=vbscript%>
<%
' Id_type=request ("Id_type")

On Error Resume Next
Response.Buffer = True
Response.Expires = 0
Dim Obj_bag,bag_item,cart
' Obj_bag----Shopping cart
' Bag_item----Product Information data collection
' Cart----Information data collection for a product
Dim p_id,p_name,p_price,p_manu,p_type,p_size,p_color,p_num,p_temp
' P_ID----Product ID number
' P_name----Product Name
' P_price----Original price
' P_manu----commodity manufacturer
' P_type----Product style
' P_size----Product size
' P_color----Product color
' p_num----Number of commodities
' P_temp----temporary storage p_num


If session ("login") = "" Then
Response.Write "<script langue=" "JavaScript" ">" & Chr (13)
Response.Write "Alert (" "Please login First"); "& Chr (13)
Response.Write "History.go ( -1);" & Chr (13)
Response.Write "</script>" & Chr (13)
Else
' Initialize the inside of the shopping cart variable
P_id=trim (Request ("id"))
P_manu=trim (Request ("Manu"))
P_type=trim (Request ("type"))
P_name=replace (Trim (Request ("name1"), "", "")
P_price=trim (Request ("Price")
P_size=trim (Request ("size"))
P_color=trim (Request ("color")
P_num=trim (Request ("num")

if (not IsNumeric (p_num)) or (p_num<= "0") or (InStr (1,p_num, ".") <>0)) Then
P_num=1 ' If the quantity of goods is less than 0 or there are small points, take 1
End If

If P_name <> "" Then
' If you have a shopping cart, prepare to install it.
' If you don't have a shopping cart, create a new Dictionary object

&n



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.