<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>購買水果</title>
</head>
<% 
if Request("B1")="確定" then
  Data=Request.Cookies("BuyData")
  session("address")=request("textfield")
  Data=Data& Session("Para")(0) & "," & Session("Para")(2) & "," & Session("Para")(3) &","& Trim(Request("Quity"))&"*"
  Response.Cookies("BuyData")=Data
  Response.Cookies("BuyData").Expires=Now+30
  porq=right(Session("Para")(4),1)
  Page=left(Session("Para")(4),len(Session("Para")(4))-1)
  if porq="1" then
	  Response.Redirect "Product.asp?ToPage="&Page
   else
   	  Response.Redirect "Query.asp?ToPage="&Page
  end if
end if
%>

<%
Dim Para(5)
ParaList=Request.ServerVariables("Query_String")
Prod_array=Split(ParaList,"&")
for i=0 to UBound(Prod_array)
   temp=Split(Prod_array(i),"=")
   Para(i)=temp(1)
next   
Session("Para")=Para
%>
<body leftmargin="30" background="bg2.jpg">
<p>請填入想要購買的數量後按[確定]按鈕</P>
<form method="POST" action="buy.asp">
<p>水果名稱：<input type=text value=<%=Para(1)%> Readonly size="20" name="1" >&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p> 
單價：<input type=text value=<%=Para(2)%> Readonly size="14" name="2" ></p>
<p>購買數量：<input type=text value=1 size="10" name="Quity"></p>

<p>送貨地址：
  <font color="silver"><input type="text" name="textfield" value="<%response.write session("address")%>"></font>
</p>
<p align="center"><input type="submit" value="確定" name="B1"></p>
</form>

</body>

</html>
