因为对科汛系统的由衷佩服,小弟不才,现写出原理:
假定 自定义静态标签A 里有一个表单(或模板文件里),
<FORM name="myform" onSubmit="return CheckForm();" action="/sp1/shop/wll.asp" method="post">
<table class="border" cellSpacing=1 cellPadding=3 width="95%" align=center border=0>
<tr class=title align=middle>
<td colSpan=4 height=25>请填写订单信息</td>
</tr>
<tr class=tdbg>
<td align=right width=100>收货人姓名:</td>
<td colSpan=3>
<INPUT id=ContactMan maxLength=50 value="" name=ContactMan size="20"> * </td>
</tr>
<tr class=tdbg>
<td align=right width=100>收货人地址:</td>
<td colSpan=3><INPUT id=Address maxLength=255 size=60 value="" name=Address> *</td>
</tr>
<tr class=tdbg>
<td align=right width=100>收货人邮编:</td>
<td colSpan=3 height=20>
<INPUT id=ZipCode maxLength=6 value="" name=ZipCode size="20"> * </td>
</tr>
<tr class=tdbg>
<td align=right width=100>收货人电话:</td>
<td colSpan=3><INPUT id=Phone maxLength=50 size=30 value="" name=Phone> * </td>
</tr>
<tr class=tdbg>
<td align=right width=100>收货人邮箱:</td>
<td colSpan=3 height=20><INPUT id=Email maxLength=100 size=30 value="" name=Email></td>
</tr>
<tr class=tdbg>
<td align=right width=100>收货人手机:</td>
<td colSpan=3><INPUT id=Mobile maxLength=50 size=30 value="" name=Mobile></td>
</tr>
<tr class=tdbg>
<td align=right>收货人QQ:</td>
<td colSpan=3><INPUT id=QQ maxLength=50 size=30 value="" name=QQ></td>
</tr>
<tr class=tdbg>
<td align=right width=100>***信息:</td>
<td colSpan=3><TEXTAREA id=InvoiceContent name="InvoiceContent" rows=3 cols=42>***抬头:
商品名称:
***金额: 元</textarea> <INPUT id=NeedInvoice type="checkbox" value="1" name="NeedInvoice"> 是否需要*** </td>
</tr>
<tr class=tdbg>
<td align=right width=100>请在备注/留言里写清产品型号与数量,不明白型号,请在下面点击查看: </td>
<td colSpan=3>
<TEXTAREA id=Remark name=Remark cols=50 rows="9"></textarea> </td>
</tr>
<tr>
<td align=right width=100>产品查看</td>
<td colSpan=3>
{SQL_listpro()} <!-----这里列出所有产品,便于客户填表时进行参考---->
</td>
</tr>
<tr>
<td class=tdbg align=middle colSpan=4 height=50><INPUT id=Action type=hidden value=Confirm name=Action><INPUT type=submit value="确认订单 >>" name=submit> <INPUT type=reset value=重新填写信息 name=reset> </td>
</tr>
</table>
</form>
此表单请求 wlll.asp
下面贴出wlll.asp文件。(此文件放于shop/目录下)
为了在后台里能看到在线定购,我们还要在 shop/Admin_shoporder.asp文件里,
Response.Write "<script>alert('找不到相关商品');history.back();</script>"
之前加上exit function这一句,因为…………。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Conn.asp"-->
<%
ContactMan = trim(request.form("ContactMan"))
ZipCode = trim(request.form("ZipCode"))
Phone = trim(request.form("Phone"))
Email = trim(request.form("Email"))
Mobile = trim(request.form("Mobile"))
QQ = trim(request.form("QQ"))
InvoiceContent = trim(request.form("InvoiceContent"))
NeedInvoice = trim(request.form("NeedInvoice"))
Remark = trim(request.form("Remark"))
Set RS=Server.CreateObject("ADODB.RecordSet")
RS.Open "Select * From KS_Order",Conn,1,3
RS.AddNew
'RS("OrderID")=OrderID '订单号
RS("OrderID") = Year(Now)&right("0"&Month(Now),2)&right("0"&Day(Now),2)
RS("UserName") = "游客"
'RS("MoneyTotal") = "RealMoneyTotal"
'RS("MoneyGoods") = "MoneyGoods"
'RS("NeedInvoice")=NeedInvoice '是否要***
'RS("InvoiceContent")=InvoiceContent '***内容
RS("Remark")=Remark '留言
RS("InputTime")=Now
RS("ContactMan")=ContactMan
'收货人
RS("Address")=Address '收货人地址
RS("ZipCode")=ZipCode '邮编号
RS("Mobile")=Mobile '手机
RS("Phone")=Phone '电话
RS("QQ")=QQ 'QQ
RS("Email")=Email
'RS("PaymentType")= "PaymentType" '方式
'RS("DeliverType")= "DeliverType" '方式
'RS("Discount_Payment")= "PaymentDiscount" '付款方式折扣率
'RS("Charge_Deliver")= "DeliveryMoney" '运费
'相关初始值
RS("Invoiced")=0 '***未开
RS("MoneyReceipt")=0 '已收款
RS("BeginDate")=Now '开始服务日期
RS("Status")=0 '订单状态
RS("DeliverStatus")=0 '送货状态
RS("PresentMoney")=0 '返回客户现金
RS("PresentPoint")=0 '返回客户点券
RS("PresentScore")=0 '返回客户积分
RS.Update
RS.Close:Set RS=Nothing
'此处可显示一个预览页面,这里从略
response.write("<script>alert('订单提交成功,不仅将与您电话联系!');location.replace('/sp1/')</script>")
%>
[此贴子已经被作者于2007-1-15 7:42:17编辑过]