ProductBuySave.asp
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:3k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

ASP/ASPX

  1. <% response.charset="utf-8" %>
  2. <!--#include file="../skweb/Const.asp" -->
  3. <!--#include file="../skweb/ConnSiteData.asp" -->
  4. <!--#include file="../skweb/Function.asp"-->
  5. <%
  6. dim ProductName,ProductNo,Amount,Remark,StartDate
  7. dim MemID,RealName,Sex,Company,Address,ZipCode,Telephone,Fax,Mobile,Email,VerifyCode
  8. dim rs,sql
  9. StartDate=request.form("Start_Date")
  10. ProductName=trim(request.form("ProductName"))
  11. ProductNo=trim(request.form("ProductNo"))
  12. Amount=trim(request.form("Amount"))
  13. Remark=request.form("Remark")
  14. MemID=request.QueryString("MemberID")
  15. RealName=trim(request.form("RealName"))
  16. Sex=trim(request.form("Sex"))
  17. Company=trim(request.form("Company"))
  18. Address=trim(request.form("Address"))
  19. ZipCode=trim(request.form("ZipCode"))
  20. Telephone=trim(request.form("Telephone"))
  21. Fax=trim(request.form("Fax"))
  22. Mobile=trim(request.form("Mobile"))
  23. Email=trim(request.form("Email"))
  24. dim ErrMessage,ErrMsg(9),FindErr(9),i
  25.   ErrMsg(0)="·产品名称必填,长度不能超过100个字符"
  26.   ErrMsg(1)="·产品编号必填,长度不能超过50个字符"
  27.   ErrMsg(2)="·订购数量必填,长度不能超过50个字符."
  28.   ErrMsg(3)="·姓名必填,长度不能超过50个字符"
  29.   ErrMsg(4)="·单位名称、地址必填,长度为8-100个字符"
  30.   ErrMsg(5)="·邮编必填长度为6-20个字符"
  31.   ErrMsg(6)="·电话必填长度为11-50个字符"
  32.   ErrMsg(7)="·传真、移动电话长度不能超过50个字符"
  33.   ErrMsg(8)="·电子邮箱格式不正确"
  34.   ErrMsg(9)="·验证码错误或已失效"
  35. if len(ProductName)>100 or len(ProductName)=0 then
  36.   FindErr(0)=true
  37. end if  
  38. if len(ProductNo)>50 or len(ProductNo)=0 then
  39.   FindErr(1)=true
  40. end if  
  41. if len(Amount)>50 or len(Amount)=0 then
  42.   FindErr(2)=true
  43. end if
  44. if len(RealName)>50 or len(RealName)=0 then
  45.   FindErr(3)=true
  46. end if
  47. if len(Company)>100 or len(Address)>100 or len(Company)<4 or len(Address)<4 then
  48.   FindErr(4)=true
  49. end if
  50. if len(ZipCode)>20 or len(ZipCode)<6 then
  51.   FindErr(5)=true
  52. end if
  53. if len(Telephone)>50 or len(Telephone)<11 then
  54.   FindErr(6)=true
  55. end if
  56. if len(Fax)>50 or len(Mobile)>50 then
  57.   FindErr(7)=true
  58. end if
  59. if not IsValidEmail(Email) then
  60.   FindErr(8)=true
  61. end if
  62. for i = 0 to UBound(FindErr)
  63.   if FindErr(i)=true then
  64.     ErrMessage=ErrMessage+ErrMsg(i)+"<br>"
  65.   end if
  66. next
  67. if not (ErrMessage="" or isnull(ErrMessage)) then
  68.   WriteMsg(ErrMessage)
  69.   response.end
  70. end if
  71. set rs = server.createobject("adodb.recordset")
  72. sql="select * from sk_Order"
  73. rs.open sql,conn,1,3
  74. rs.addnew
  75. rs("Start_Date")=StartDate
  76. rs("ProductName")=StrReplace(ProductName)
  77. rs("ProductNo")=StrReplace(ProductNo)
  78. rs("Amount")=StrReplace(Amount)
  79. rs("Remark")=StrReplace(Remark)
  80. rs("MemID")=MemID
  81. rs("Linkman")=StrReplace(RealName)
  82. rs("Sex")=Sex
  83. rs("Company")=StrReplace(Company)
  84. rs("Address")=StrReplace(Address)
  85. rs("ZipCode")=StrReplace(ZipCode)
  86. rs("Telephone")=StrReplace(Telephone)
  87. rs("Fax")=StrReplace(Fax)
  88. rs("Mobile")=StrReplace(Mobile)
  89. rs("Email")=Email
  90. rs("AddTime")=now()
  91. rs.update
  92. rs.close
  93. set rs=nothing
  94. WriteMsg("·订单提交成功,返回首页<a href='../index.asp'><font color='red'>[继续浏览]</font></a>。")
  95. %>