| | |
|
Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Array session problem |
From: |
kuanhoong |
Date: |
8/3/2000 10:06:13 AM |
IP: |
161.142.78.83 |
ASP code page 1
===============
<%
Dim prodid, quantity, arrCart, edagangItem
prodid = Request.Form("fproductid")
quantity = Request.Form("fquantity")
arrCart=Session("bakul")
edagangItem = Session("cartItem")
If edagangItem = "" Then
Response.Redirect "http://127.0.0.1/edagang/error.asp?msg=" &
Server.URLEncode ("Sila membenarkan cookie pada pelayar anda untuk berurusan
e-dagang.")
End If
If prodid <> "" Then
If edagangItem < maxCartItems Then
edagangItem = edagangItem + 1
End If
Session("cartItem") = edagangItem
Dim rsItem
Set rsItem = Server.CreateObject("ADODB.Recordset")
rsItem.Open "products", dbc, adOpenForwardOnly,adLockReadOnly,adCmdTable
rsItem.Filter = "catalogID = " & prodid
If Not rsItem.EOF Then
arrCart(cProductid,edagangItem) = rsItem("catID")
arrCart(cProductCode,edagangItem) = rsItem("kod")
arrCart(cProductname,edagangItem) = rsItem("name")
arrCart(cQuantity,edagangItem) = CInt(quantity)
arrCart(cUnitPrice,edagangItem) = rsItem("price")
Session("bakul") = arrCart
rsItem.Close
dbc.Close
End If
Else
Dim strAction
strAction = UCase(Left(Request.Form("action"),5))
Select Case strAction
case "SAMBU"
response.redirect "http://127.0.0.1/edagang/edagang.asp"
Case "HAPUS"
response.redirect "http://127.0.0.1/edagang/hapus.asp"
Case "SIAP "
Response.Redirect "http://127.0.0. |
|
|

|
|
|
|