HTML: (thanks for any help!!!)
<HTML>
<HEAD>
<TITLE>Simple Shopping Cart Example</TITLE>
</HEAD>
<BODY>
<CENTER><H1>Supply Shop</H1></CENTER>
<HR>
<FORM ACTION="SupplyCart.asp" METHOD="post">
<TABLE CELLSPACING="5" CELLPADDING="5">
<TR>
<TD ALIGN="LEFT"><B>Add to Cart</B></TD>
<TD ALIGN="center"></TD>
</TR>
<TR>
<TD ALIGN="right"><SELECT MULTIPLE SIZE="2" NAME="item">
<OPTION>Pencils
<OPTION>Pens
<OPTION>Notebook Paper
<OPTION>Notebooks
</SELECT>
<TD></TD>
</TR>
</TABLE>
<HR>
<INPUT TYPE="Submit" VALUE="Add to Cart">
</FORM>
</BODY>
</HTML>
ASP:
<%@Language=JScript%>
<%Response.buffer=true%>
<HTML>
<HEAD>
<TITLE>Simple Shopping Cart Example</TITLE>
</HEAD>
<BODY>
<CENTER><H1>Student's Supply Shop</H1></CENTER>
<H2>Items currently in your cart</H2>
<HR>
<%
var i,j,itemcount,item,items;
if (Request.Cookies("SupplyCart" == "" {
Response.Cookies("SupplyCart"("itemcount" = 0;
itemcount = 0;
j = 0;
}
else
{
itemcount = Request.Cookies("SupplyCart"("itemcount"
j = 0;
}
for (i=0; i<itemcount; i++) {
Response.Cookies("SupplyCart"("item"+i) = Request.Cookies("SupplyCart"("item"+i);
Response.Write(Request.Cookies("SupplyCart"("item"+i)+"<BR>"
j = j + 1;
}
items = new Enumerator(Request.Form("item");
while (!items.atEnd())
{
item = items.item();
Response.Cookies("SupplyCart"("item"+j) = item;
Response.Write(item+"<BR>"
j = j + 1;
items.moveNext();
}
ExpireDate = new Date();
ExpireDate.setMonth(ExpireDate.getMonth()+3); //Expires in 3 months from today
Response.Cookies("SupplyCart".expires = ExpireDate.toLocaleString(); <<<<is it this?
Response.Cookies("SupplyCart"("itemcount" = j;
%>
<HR>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>Simple Shopping Cart Example</TITLE>
</HEAD>
<BODY>
<CENTER><H1>Supply Shop</H1></CENTER>
<HR>
<FORM ACTION="SupplyCart.asp" METHOD="post">
<TABLE CELLSPACING="5" CELLPADDING="5">
<TR>
<TD ALIGN="LEFT"><B>Add to Cart</B></TD>
<TD ALIGN="center"></TD>
</TR>
<TR>
<TD ALIGN="right"><SELECT MULTIPLE SIZE="2" NAME="item">
<OPTION>Pencils
<OPTION>Pens
<OPTION>Notebook Paper
<OPTION>Notebooks
</SELECT>
<TD></TD>
</TR>
</TABLE>
<HR>
<INPUT TYPE="Submit" VALUE="Add to Cart">
</FORM>
</BODY>
</HTML>
ASP:
<%@Language=JScript%>
<%Response.buffer=true%>
<HTML>
<HEAD>
<TITLE>Simple Shopping Cart Example</TITLE>
</HEAD>
<BODY>
<CENTER><H1>Student's Supply Shop</H1></CENTER>
<H2>Items currently in your cart</H2>
<HR>
<%
var i,j,itemcount,item,items;
if (Request.Cookies("SupplyCart" == "" {
Response.Cookies("SupplyCart"("itemcount" = 0;
itemcount = 0;
j = 0;
}
else
{
itemcount = Request.Cookies("SupplyCart"("itemcount"
j = 0;
}
for (i=0; i<itemcount; i++) {
Response.Cookies("SupplyCart"("item"+i) = Request.Cookies("SupplyCart"("item"+i);
Response.Write(Request.Cookies("SupplyCart"("item"+i)+"<BR>"
j = j + 1;
}
items = new Enumerator(Request.Form("item");
while (!items.atEnd())
{
item = items.item();
Response.Cookies("SupplyCart"("item"+j) = item;
Response.Write(item+"<BR>"
j = j + 1;
items.moveNext();
}
ExpireDate = new Date();
ExpireDate.setMonth(ExpireDate.getMonth()+3); //Expires in 3 months from today
Response.Cookies("SupplyCart".expires = ExpireDate.toLocaleString(); <<<<is it this?
Response.Cookies("SupplyCart"("itemcount" = j;
%>
<HR>
</BODY>
</HTML>