cookies

serena_cp

Nuovo Utente
27 Apr 2005
8
0
0
ho pubblicato un sito di e-commerce.
il database viene letto.
si vedono le categorie e poi si passa ai vari articoli di quella categoria però quando si inserisce la quantità x acquistare e si clicca su acquista appare il seguente messaggio:


Error
We notice you do no accept cookies. Please enable cookies to shop.

... questa frase l'ho trovata all'interno di uno codice html in una pag ASP del mio sito.... però non riesco a capire perchè appare.

il mio pc accetta i cookies ... come si può fare ad abilitare il mio programma ad accettare i cookies????

se serve posso postare il codice

attendo risposta

grazie

Serena_cp
 

serena_cp

Nuovo Utente
27 Apr 2005
8
0
0
si!!!!
quello che leggi sotto è il codice (il fatto è che non so come ovviare al problema):

<!-- #include file="db.asp" -->
<%
'===================================================
'
'
'===================================================

'shopping cart code on this page -
'generates session variables with order items
Dim prodid, quantity, arrCart, scartItem
prodid = Request.Form("fproductid")
quantity = Request.Form("fquantity")
arrCart = Session("MyCart")
scartItem = Session("arrCart")

If scartItem = "" Then
Response.Redirect "error.asp?msg=" & Server.URLEncode ("We noticed you do not accept cookies. Please enable cookies to shop.")
else
if quantity <> "" AND quantity < 1 then
Response.Redirect "error.asp?msg=" & Server.URLEncode ("Please enter at least 1 as number of items you wish to order.")
end if
End If

If prodid <> "" Then
call addToCart()
Else
Dim strAction
strAction = UCase(Left(Request.Form("action"),5))
Select Case strAction
Case "CONTI" 'continue shopping
Response.Redirect "Default.asp"
Case "RECAL" 'recalculate
call recalculateCart()
Case "PROCE" 'proceed to checkout
Response.Redirect "customer.asp"
End Select
'end if for updating or inserting new item in Cart
End If

sub addToCart()
If scartItem < maxCartItems Then
scartItem = scartItem + 1
End If
Session("cartItem") = scartItem
dim rsItem, sqlProductInfo
sqlProductInfo = "SELECT * FROM products WHERE (products.catalogID=" & prodid & ")"

'open connection - returns dbc as Active connection
call openConn()
Set rsItem = Server.CreateObject("ADODB.Recordset")
rsItem.Open sqlProductInfo, dbc, adOpenForwardOnly,adLockReadOnly,adCmdText
If Not rsItem.EOF Then
arrCart(cProductid,scartItem) = rsItem("catalogID")
arrCart(cProductCode,scartItem) = rsItem("ccode")
arrCart(cProductname,scartItem) = rsItem("cname")
arrCart(cQuantity,scartItem) = CInt(quantity)
arrCart(cUnitPrice,scartItem) = rsItem("cprice")
Session("MyCart") = arrCart
End If
rsItem.Close
set rsItem = nothing
call closeConn()
end sub


sub recalculateCart()
For i = 1 To scartItem
Dim tquantity
tquantity = Request.Form("quantity" & Cstr(i))
if isempty(tquantity) OR (tquantity = "") then
tquantity = 0
elseif (tquantity < 0) OR (isnumeric(tquantity)=false) then
tquantity = 0
end if
arrCart(cQuantity,i) = CInt(tquantity)
Next
'make temp array and set it empty
ReDim temparrcart(UBound(arrCart,1),UBound(arrCart,2))
Dim tempItems
tempItems = 0
For x = 1 to UBound(arrCart,1)
For y = 1 to UBound(arrCart,2)
temparrCart(x,y) = ""
Next
Next
For i = 1 to scartItem
confirm = Request.Form("selected" & CStr(i))
zeroQuantity = arrCart(cQuantity,i)
If confirm <> "" and zeroQuantity > 0 Then
tempItems = tempItems +1
For x = 1 to UBound(arrCart,1)
temparrCart(x,tempItems) = arrCart(x,i)
Next
End If
Next
For x = 1 to UBound(arrCart,1)
For y = 1 to UBound(arrCart,2)
arrCart(x,y) = temparrCart(x,y)
Next
Next
scartItem = tempItems

Session("cartItem") = scartItem
Session("MyCart") = arrCart

end sub

'procedure builds Cart contents table
sub showCart()
'double quote character
q = chr(34)
if scartItem = 0 then
strURL = Request.ServerVariables("HTTP_REFERER")
strFile = Request.ServerVariables("PATH_INFO")
if right(strURL,8) = right(strURL,8) then
strURL = "Default.asp"
end if
strHTML = "<h3>Your shopping cart is empty.</h3>"
strHTML = strHTML & "<p><a href=" & q & strURL & q & ">Continue shopping.</a></p>"
else
strHTML = "<FORM action="& q &"addprod.asp"& q &" method="& q &"POST"& q &">"
strHTML = strHTML & "<table border=0 cellPadding=3 cellSpacing=2 width="&q&"100%"&q&">"
strHTML = strHTML & "<tr bgColor=darkblue>"
strHTML = strHTML & "<td><FONT color=white>Product code</FONT></td>"
strHTML = strHTML & "<td><FONT color=white>Product name</FONT></td>"
strHTML = strHTML & "<td><FONT color=white>Quantity</FONT></td>"
strHTML = strHTML & "<td><FONT color=white>Unit Price</FONT></td>"
strHTML = strHTML & "<td><FONT color=white>Total</FONT></td></tr>"

Dim isubtotal, i
isubtotal = 0
For i = 1 to scartItem
strHTML = strHTML & "<tr bgColor=navajowhite>"
strHTML = strHTML & "<td><input name=selected"& Cstr(i)&" type=checkbox value="&q&"yes"&q&" checked>" & arrCart(cProductCode,i) &"</td>"
strHTML = strHTML & "<td>" & arrCart(cProductname,i) & "</td>"
strHTML = strHTML & "<td><input type="&q&"text"&q&" name="&q & "quantity" & CStr(i) & q &" value="&q & arrCart(cQuantity,i) &q&" size=3></td>"
strHTML = strHTML & "<td>" & FormatCurrency(arrCart(cUnitPrice,i),2) & "</td>"
strHTML = strHTML & "<td>" & FormatCurrency(arrCart(cUnitPrice,i) * arrCart(cQuantity,i),2) & "</td>"
strHTML = strHTML & "</tr>"
isubtotal = isubtotal + (arrCart(cUnitPrice,i) * arrCart(cQuantity,i))
Next

strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td></td><td></td><td></td>"
strHTML = strHTML & "<td bgColor=darkblue><font color=white>Total</font></td>"
strHTML = strHTML & "<td bgColor=lightgoldenrodyellow>" & FormatCurrency(isubtotal,2) & "</td>"
strHTML = strHTML & "</tr>"
strHTML = strHTML & "</table>"
strHTML = strHTML & "<input name="&q&"action"&q&" type="&q&"submit"&q&" value="&q&"Continue shopping"& q &">"
strHTML = strHTML & "<input name="&q&"action"&q&" type="&q&"submit"&q&" value="&q&"Recalculate"&q&"><br>"
strHTML = strHTML & "<input name="&q&"action"&q&" type="&q&"submit"&q&" value="&q&"Proceed to check out"&q&">"
strHTML = strHTML & "</form>"
end if

response.write strHTML
end sub
%>

<HTML>
<HEAD>
<title>Shopping cart items</title>
<link rel="stylesheet" type="text/css" href="eposter.css">
<meta name="Microsoft Border" content="tlb, default">
</HEAD>
<BODY>
<table border="0" width="600" cellpadding="4">
<tr>
<td width="100%" colspan="2" valign="top">
<h3><img src="images/eplogo2.gif" alt="eplogo.gif (2683 bytes)" width="187" height="36">
<br><font face="Arial">Shopping Cart Items:</font></h3>
</td>
</tr>
<tr>
<td width="120" bgcolor="#004080" valign="top">
<!--#include file="navleft.htm" --></td>
<td width="480">

<P>
<%
call showCart()
%>
</P>

</td>
</tr>
</table>



</BODY>
</HTML>


mi puoi dare una mano per eliminare il problema???

il mio pc accetta i cookies, quindi non so per quale motivo mi da questo messaggio...

... naturalmente questro codice è un codice open source di un carrello elettronico trovato on line.


attendo buone nuove

grazie

Serena
 

metalgemini

Utente Attivo
14 Apr 2004
745
0
0
Mai fidarsi dei codici open source

Mai fidarsi dei codici open source fatti da altri...fai prima ad imparare a farlo da sola...con quelli alla fine riscontri sempre dei problemi...e cmq secondo me è molto più divertente imparare a fare le cose anzichè usarne di già pronte.
Se vuoi imparare a fare una carrello posso darti qualche dritta...se ce l'ho fatta io da solo ce la puoi fare anke tu.
Ciao ciao

P.s.: Mi è venuto in mente proprio adesso che ho avuto il tuo stesso e identico problema con un open source...mi diceva dei cookies anche se li avevo abilitati...sarà lo stesso come minimo! :hammer:
 
Ultima modifica:
Discussioni simili
Autore Titolo Forum Risposte Data
A Legge EU Cookies Leggi, Normative e Fisco 2
C [PHP] Cookies settare path PHP 0
F [HTML] Failed script su coffee cookies HTML e CSS 1
W [Javascript] Banner per accettazione cookies Javascript 4
V Informazione Cookies ed altro Leggi, Normative e Fisco 2
trattorino [Javascript] Ricordare il click con i cookies Javascript 8
Antonio Nervi [Javascript] Problema visualizzazione banner accettazione cookies Javascript 6
E banner cookies: come non farlo riapparire? PHP 7
L Cookies e rilevamento Leggi, Normative e Fisco 0
F Mi aiutate ad adeguare i miei siti alle nuove norme sui cookies? HTML e CSS 54
A Cookies e PHP PHP 2
A cookies Leggi, Normative e Fisco 0
C Cookies strani...come rimuoverli WordPress 5
R cookies policy - help Leggi, Normative e Fisco 21
S Cookies Discussioni Varie 0
A javascript e cookies Javascript 2
F Normativa cookies Leggi, Normative e Fisco 0
N Programma per gestire Cookies secondo disposizioni del Garante Privacy 3/6/2014 G.U. 126 Leggi, Normative e Fisco 0
R Sessioni, cookies e token di autenticazione PHP 0
P Problema con i cookies PHP 2
S Problema con i cookies Javascript 3
A cancellare TUTTI i cookies PHP 2
L Errore Cookies Javascript 4
G Cookies impazziti PHP 8
Silen cookies per tenere attiva una sessione PHP 42
M sessioni o cookies? PHP 0
Z Controllo Cookies per Poll PHP 1
D Cookies e accesso Classic ASP 0
D Cookies, Sessions and Logs PHP 0
B prelevare cookies per fini di sviluppo PHP 2
L come cancellare i cookies Windows e Software 0
S Cookies in Javascript Javascript 0
B Cookies PHP 2
S cookies HTML e CSS 3
F Cookies! Hardware 0
M Verifica dei cookies Javascript 2
E Carrello e cookies multiutente Classic ASP 4
jan267 Eliminazione dei cookies da ASP Classic ASP 2

Discussioni simili