ProductBuySave.asp
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:3k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
ASP/ASPX
- <% response.charset="utf-8" %>
- <!--#include file="../skweb/Const.asp" -->
- <!--#include file="../skweb/ConnSiteData.asp" -->
- <!--#include file="../skweb/Function.asp"-->
- <%
- dim ProductName,ProductNo,Amount,Remark,StartDate
- dim MemID,RealName,Sex,Company,Address,ZipCode,Telephone,Fax,Mobile,Email,VerifyCode
- dim rs,sql
- StartDate=request.form("Start_Date")
- ProductName=trim(request.form("ProductName"))
- ProductNo=trim(request.form("ProductNo"))
- Amount=trim(request.form("Amount"))
- Remark=request.form("Remark")
- MemID=request.QueryString("MemberID")
- RealName=trim(request.form("RealName"))
- Sex=trim(request.form("Sex"))
- Company=trim(request.form("Company"))
- Address=trim(request.form("Address"))
- ZipCode=trim(request.form("ZipCode"))
- Telephone=trim(request.form("Telephone"))
- Fax=trim(request.form("Fax"))
- Mobile=trim(request.form("Mobile"))
- Email=trim(request.form("Email"))
- dim ErrMessage,ErrMsg(9),FindErr(9),i
- ErrMsg(0)="·产品名称必填,长度不能超过100个字符"
- ErrMsg(1)="·产品编号必填,长度不能超过50个字符"
- ErrMsg(2)="·订购数量必填,长度不能超过50个字符."
- ErrMsg(3)="·姓名必填,长度不能超过50个字符"
- ErrMsg(4)="·单位名称、地址必填,长度为8-100个字符"
- ErrMsg(5)="·邮编必填长度为6-20个字符"
- ErrMsg(6)="·电话必填长度为11-50个字符"
- ErrMsg(7)="·传真、移动电话长度不能超过50个字符"
- ErrMsg(8)="·电子邮箱格式不正确"
- ErrMsg(9)="·验证码错误或已失效"
- if len(ProductName)>100 or len(ProductName)=0 then
- FindErr(0)=true
- end if
- if len(ProductNo)>50 or len(ProductNo)=0 then
- FindErr(1)=true
- end if
- if len(Amount)>50 or len(Amount)=0 then
- FindErr(2)=true
- end if
- if len(RealName)>50 or len(RealName)=0 then
- FindErr(3)=true
- end if
- if len(Company)>100 or len(Address)>100 or len(Company)<4 or len(Address)<4 then
- FindErr(4)=true
- end if
- if len(ZipCode)>20 or len(ZipCode)<6 then
- FindErr(5)=true
- end if
- if len(Telephone)>50 or len(Telephone)<11 then
- FindErr(6)=true
- end if
- if len(Fax)>50 or len(Mobile)>50 then
- FindErr(7)=true
- end if
- if not IsValidEmail(Email) then
- FindErr(8)=true
- end if
- for i = 0 to UBound(FindErr)
- if FindErr(i)=true then
- ErrMessage=ErrMessage+ErrMsg(i)+"<br>"
- end if
- next
- if not (ErrMessage="" or isnull(ErrMessage)) then
- WriteMsg(ErrMessage)
- response.end
- end if
- set rs = server.createobject("adodb.recordset")
- sql="select * from sk_Order"
- rs.open sql,conn,1,3
- rs.addnew
- rs("Start_Date")=StartDate
- rs("ProductName")=StrReplace(ProductName)
- rs("ProductNo")=StrReplace(ProductNo)
- rs("Amount")=StrReplace(Amount)
- rs("Remark")=StrReplace(Remark)
- rs("MemID")=MemID
- rs("Linkman")=StrReplace(RealName)
- rs("Sex")=Sex
- rs("Company")=StrReplace(Company)
- rs("Address")=StrReplace(Address)
- rs("ZipCode")=StrReplace(ZipCode)
- rs("Telephone")=StrReplace(Telephone)
- rs("Fax")=StrReplace(Fax)
- rs("Mobile")=StrReplace(Mobile)
- rs("Email")=Email
- rs("AddTime")=now()
- rs.update
- rs.close
- set rs=nothing
- WriteMsg("·订单提交成功,返回首页<a href='../index.asp'><font color='red'>[继续浏览]</font></a>。")
- %>