打印本文 打印本文  关闭窗口 关闭窗口
一个简单的网上书城的例子(八)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:05:47
buyfinish.asp:完成一次交易!记录客户信息!

<%
Name=Request("Customer_N")
Tel=Request("Customer_T")
Address=Request("Customer_A")
ProductID=Request("Customer_P")
ProductName=Request("Customer_PN")
Quatity=Request("Customer_Q")
Sum=Request("Customer_S")
Session("ProductList")=""
%>
<HEAD><META HTTP-EQUIV="REFRESH" CONTENT="30; URL=main.asp"></HEAD>
<body background=B01.jpg>
<%=sql%><br>
<center><h2><font color=blue>顾客购物信息:</h2></font>
<table width=50% border=1><tr><td>
姓名:<%=Name%><br>
电话:<%=Tel%><br>
住址:<%=Address%><br>
<% Products = Split(ProductID, "/")
   ProductNames = Split(ProductName, "/")
   Quatities = Split(Quatity,"/") %>
   书刊编号__书刊名称 (数量)<br>
   <% For I=0 To UBound(Products) %>
   <%=Products(i)%>__<%=ProductNames(i)%> (<%=Quatities(i)%>)<br>
<%next%>
书刊总价:<%=Sum%><br>
</td></tr></table>
上述购物清单已提交服务台办理。多谢惠顾!
<hr width=80%>
<a href=main.asp>返回</a>
</body>
<%
sql = "Insert into BuyInfomation (Name,Tel,Address,ProductID,Quatity,Sum) "
sql = sql & " Values ( '"+Name+"','"+Tel+"','"+Address+"','"+ProductID+"','"+Quatity+"','"+Sum+"')"
DbPath = SERVER.MapPath("ShopBag.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath
Set rs = conn.Execute( sql )
Set conn=nothing
%>




打印本文 打印本文  关闭窗口 关闭窗口