<!--#include file="byshop_conn.asp"-->
<!--#include file="../md5.asp"-->
<!--#include file="../webconfig.asp"-->
<%

ServerName1=Cstr(Request.ServerVariables("HTTP_REFERER"))
ServerName2=Cstr(Request.ServerVariables("SERVER_NAME"))
If Mid(ServerName1,8,len(ServerName2))<>ServerName2 Then
    Response.Write "路径有误，禁止从网站外部提交表单！"
End if

Public Function FilterHtml(Str)
    If Trim(Str) = "" Or IsNull(Str) Then
        FilterHtml=""
    Else
    Str = Replace(Str, ">", "&gt;")
    Str = Replace(Str, "<", "&lt;")
    Str = Replace(Str, Chr(32), "&nbsp;")
    Str = Replace(Str ,Chr(9), "&nbsp;")
    Str = Replace(Str, Chr(34), "&quot;")
    Str = Replace(Str, Chr(39), "&#39;")
    Str = Replace(Str, Chr(13), "")
    Str = Replace(Str, Chr(10) & Chr(10), "</p><p>")
    Str = Replace(Str, Chr(10), "<br> ")
    FilterHtml = Str
    End If
End Function
agree=replace(trim(request.form("agree")),"'","")
user=replace(trim(request.form("username")),"'","")
user=FilterHtml(user)
set rs=server.CreateObject ("adodb.recordset")
sql="select * from byshop_user where user='"&user&"'"
rs.open sql,conn,1,1
if rs.recordcount >= 1 then
response.write rs.recordcount
response.write"<SCRIPT language=JavaScript>alert('该用户名已经存在，重新填写用户名。');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end 
rs.close
set rs=nothing
end if

company=replace(trim(request.form("company")),"'","")
company=FilterHtml(company)
set rs=server.CreateObject ("adodb.recordset")
sql="select * from byshop_user"
rs.open sql,conn,1,3
rs.addnew
rs("user")=user'用户名
rs("company")=company'公司名称
rs("pass")=md5(trim(request.form("password")))'密码
rs("email")=FilterHtml(trim(request.form("email")))'电子邮箱
rs("name")=FilterHtml(trim(request.form("realname")))'真实姓名
rs("sex")=int(request.form("sex"))'性别
rs("address")=FilterHtml(trim(request.form("address")))'公司地址
rs("tel")=FilterHtml(trim(request.form("tel")))'电话号码
rs("mobile")=FilterHtml(trim(request.form("mobile")))'手机号码
rs("fax")=FilterHtml(trim(request.form("fax")))'传真号码
rs("web")=FilterHtml(trim(request.form("web")))'公司网址
rs("usersort")=FilterHtml(trim(request.form("usersort")))'会员类型
rs("contract")=FilterHtml(trim(request.form("contract")))'联系方式
rs("contract2")=FilterHtml(trim(request.form("contract2")))'联系方式2
rs("address")=FilterHtml(trim(request.form("address")))'地址
rs("jyfw")=FilterHtml(trim(request.form("operation")))'主要业务
rs("message")=FilterHtml(trim(request.form("message")))'公司简介
rs("lastip")=Request.ServerVariables("REMOTE_ADDR")'
rs("addtime")=date()
rs("count")=0
rs("shenghe")=0
rs.update
rs.close
set rs=noting
if agree <>"on" then
  response.write"<SCRIPT language=JavaScript>alert('恭喜您!成为"&WebName&"的会员，您对本站的服务条约有异议，请及时联系我们！'); "
  response.write"this.location.href='login.asp';</SCRIPT>"
 response.end 
 else
  response.write"<SCRIPT language=JavaScript>alert('恭喜您!成为"&WebName&"的会员！');"
   response.write"this.location.href='login.asp';</SCRIPT>" 
   response.end 
     end if 
%>
 
 