欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

一个简单的网上书城的例子(八)

程序员文章站 2022-03-02 21:50:37
buyfinish.:完成一次交易!记录客户信息!<%name=request("customer_n")tel=request("customer_t"...
buyfinish.:完成一次交易!记录客户信息!

<%
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
%>