"
'验证是为站外提交表单
if Not ChkPost then response.redirect ("chklogin.jsp?login=4")
'首先开始验证是否输入了验证码及是否正确,这是避免非法注册
if Replace_Text(request.form("Verifycode"))="" then
response.write"请输入验证码 (也许您输入的数字是全角状态的,如:1234,验证码必须为半 角数字,如:1234。这时候您用英文输入法,输入数字就可以了。)"
founderr=true
else
if Cint(request("Verifycode"))<>Session("SafeCode") then
response.write"请输入正确的验证码 (也许您输入的数字是全角状态的,如:1234,验证码必须为半 角数字,如:1234。这时候您用英文输入法,输入数字就可以了。)"
founderr=true
end if
end if
if Replace_Text(request.form("user"))="" then
response.write "没有填写会员登录名"
founderr=true
end if
if Replace_Text(request.form("user"))>"" then
if len(Replace_Text(request.form("user")))>20 or len(Replace_Text(request.form("user")))<6 then
response.write "会员登录名必须是6-20位字符"
founderr=true
end if
user=Replace_Text(request.form("user"))
sql="select id from corporation where [user]='"&user&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not (rs.Bof and rs.eof) then
response.write"此“会员登录名”已有人用了,请重新设置 建议: 1.在原来的会员名基础上加上几位数字。如:原来的会员名为 abcd,改成 123abcd 或 abcd123 2.把原来的会员名重复一遍。如:abcabc 3. 设置其他您喜欢的会员登录名"
founderr=true
end if
end if
if Replace_Text(request.form("pass"))="" then
response.write "密码必须是6-20个字符"
founderr=true
else
if len(Replace_Text(request.form("pass")))>20 or len(Replace_Text(request.form("pass")))<6 then
response.write "密码必须是6-20个字符"
founderr=true
else
if Replace_Text(request.form("confirmpassword"))<>Replace_Text(request.form("pass")) then
response.write "两次输入的密码不一致"
founderr=true
end if
end if
end if
if Replace_Text(request.form("question"))="" then
response.write "没有选择选择密码提示问题"
founderr=true
end if
if Replace_Text(request.form("answer"))="" then
response.write "没有填写提示问题答案"
founderr=true
end if
if Replace_Text(request.form("name"))="" then
response.write "没有填写姓名"
founderr=true
end if
if Replace_Text(request.form("ch"))="" then
response.write "没有填写性别"
founderr=true
end if
if Replace_Text(request.form("email"))="" then
response.write "没有填写电子邮箱"
founderr=true
else
if IsValidEmail(Replace_Text(request.form("email")))=false then
response.write "请填写正确的电子邮箱"
founderr=true
end if
email=Replace_Text(request.form("email"))
sql="select name,flag from corporation where email='"&email&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not (rs.Bof and rs.eof) then
response.write"
您填写的邮箱:"&email&", 已经被"&rs("name")&"注册"
response.write"
如果您是"&rs("name")&"用户,您可以选择: "
response.write""
response.write""
response.write"| 1: | "
response.write""
response.write"直接用"&rs("name")&"登录网站。 "
response.write"请点此进入"
response.write" | "
founderr=true
if rs("flag")=0 then
response.write"| 2: | "
response.write"以此用户来申请药贸通服务,同时保持邮箱"&email&"不变。 "
response.write"请点此进入"
response.write" | "
founderr=true
end if
response.write"
"
founderr=true
end if
end if
if Replace_Text(request.form("phonecountry"))="" then
response.write "没有填写电话号码国家区号"
founderr=true
end if
if Replace_Text(request.form("phonearea"))="" then
response.write "没有填写电话号码城市区号"
founderr=true
end if
if Replace_Text(request.form("phonenumber"))="" then
response.write "没有填写电话号码"
founderr=true
end if
if Replace_Text(request.form("country1"))="中国" then
if Replace_Text(request.form("province"))="" or Replace_Text(request.form("city"))="" then
response.write "国家如果选择了中国,必须选择地级市和市、县"
founderr=true
end if
end if
if Replace_Text(request.form("address"))="" then
response.write "没有填写地址"
founderr=true
end if
if Replace_Text(request.form("qymc"))="" then
response.write "没有填写公司名称"
founderr=true
else
qymc=Replace_Text(request.form("qymc"))
sql="select id from corporation where qymc='"&qymc&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not (rs.Bof and rs.eof) then
response.write"您的公司已经注册过了,请直接用您公司注册的帐号登录"
founderr=true
end if
end if
if Replace_Text(request.form("zw"))="" then
response.write "没有填写职位名称"
founderr=true
end if
if Replace_Text(request("p_z_Z_CategoryId1"))="" then
response.write "没有正确填写主营行业"
founderr=true
end if
if Replace_Text(request.form("productionService"))="" then
response.write "主营产品/服务最少要填一个"
founderr=true
end if
if founderr=false then
'开始存储数据
user=Replace_Text(request.form("user"))
pass=Replace_Text(request.form("pass"))
question=Replace_Text(request.form("question"))
answer=Replace_Text(request.form("answer"))
name1=Replace_Text(request.form("name"))
ch=Replace_Text(request.form("ch"))
email=Replace_Text(request.form("email"))
phonecountry=Replace_Text(request.form("phonecountry"))
phonearea=Replace_Text(request.form("phonearea"))
phonenumber=Replace_Text(request.form("phonenumber"))
phone=phonecountry&" "&phonearea&" "&phonenumber
country=Replace_Text(request.form("country1"))
sf=Replace_Text(request.form("province"))
city=Replace_Text(request.form("city"))
address=Replace_Text(request.form("address"))
faxcountry=Replace_Text(request.form("faxcountry"))
faxarea=Replace_Text(request.form("faxarea"))
faxnumber=Replace_Text(request.form("faxnumber"))
fax=faxcountry&" "&faxarea&" "&faxnumber
mobile=Replace_Text(request.form("mobile"))
post=Replace_Text(request.form("post"))
qymc=Replace_Text(request.form("qymc"))
zw=Replace_Text(request.form("zw"))
sortid=Replace_Text(request.form("p_z_Z_RootCategory"))
CategoryId=split(Replace_Text(request.form("p_z_Z_CategoryId1")),",")
typeid=CategoryId(0)
typeid_2=CategoryId(1)
p_z_Z_productionService=Replace_Text(request.form("p_z_Z_productionService"))
isournotify=Replace_Text(request.form("isournotify"))
if isournotify="" then
isournotify=0
else
isournotify=1
end if
isothernotify=Replace_Text(request.form("isothernotify"))
if isothernotify="" then
isothernotify=0
else
isothernotify=1
end if
idate=date()
sql="select * from corporation where [user]='"&user&"' or qymc='"&qymc&"' or email='"&email&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not (rs.Bof and rs.eof) then
response.write"您填写的会员登陆名或公司名称或E-mail已存在,请返回重新填写"
else
rs.addnew
rs("user")=user
rs("pass")=pass
rs("question")=question
rs("answer")=answer
rs("name")=name1
rs("ch")=ch
rs("tm")=tm
rs("email")=email
rs("phone")=phone
rs("country")=country
rs("sf")=sf
rs("city")=city
rs("address")=address
rs("fax")=fax
rs("mobile")=mobile
rs("post")=post
rs("qymc")=qymc
rs("zw")=zw
rs("sortid")=sortid
rs("typeid")=typeid
rs("typeid_2")=typeid_2
rs("zycp")=p_z_Z_productionService
rs("isournotify")=isournotify
rs("isothernotify")=isothernotify
rs("idate")=idate
'rs("hybz")=true '申请时即认为其已要求申请药贸通会员服务
'rs("uflag")=1 '申请时即开通普通会员,但申请者的公司仍需审核
'rs("cflag")=1 '申请时即通过审核申请者的公司
'rs("flag")=1 '申请时即开通药贸通会员服务
'rs("begindate")=idate '既然已是药贸通会员,申请者的药贸通会员服务期限从注册之日起
'rs("enddate")=idate+365 '到一年后结束
'rs("trust_score")=10 '既然已是药贸通会员,则申请者药贸通指数为10
rs.update
session("id")=rs("id")
session("user")=rs("user")
session("Email")=rs("Email")
'session("uflag")=rs("uflag")
'session("cflag")=rs("cflag")
session("flag")=rs("flag")
Response.Cookies("Myworldname") = rs("user")
Response.Cookies("Myworldname").Expires=date()+365
pharry=split(rs("phone")," ")
response.redirect ("Register_Confirm.jsp")
end if
end if
response.write " |