
<!--#include file="inc_top.asp" -->
<!--#include file="conn/email.asp" -->
<%
if request("huiyuan")="" then 
response.write "<br><br><br><div align='center'>请输入会员名称，谢谢！</div>"
response.end
end if
if request("password")="" then 
response.write "<br><br><br><div align='center'>请填写会员密码，谢谢！</div>"
response.end
end if
if request("name")="" then 
response.write "<br><br><br><div align='center'>请留下您的真实姓名，谢谢！</div>"
response.end
end if
if request("dz")="" then 
response.write "<br><br><br><div align='center'>请留下您的联系地址，谢谢！</div>"
response.end
end if
if request("tel")="" then 
response.write "<br><br><br><div align='center'>请留下您的联系电话，谢谢！</div>"
response.end
end if

dim huiyuanname
dim huiyuanpass
dim namewithpass
huiyuanname=request("huiyuan")
huiyuanpass=request("password")
namewithpass=huiyuanname+huiyuanpass

if InStr(namewithpass,"%20")<>0 or InStr(namewithpass," ")<>0 or InStr(namewithpass,"%27")<>0 or InStr(namewithpass,"'")<>0 or InStr(namewithpass,"%a1a1")<>0 or InStr(namewithpass,"　")<>0 or InStr(namewithpass,"%24")<>0 or InStr(namewithpass,"$")<>0 or InStr(namewithpass,"%3b")<>0 or InStr(namewithpass,";")<>0 or InStr(namewithpass,"%%")<>0 or InStr(namewithpass,"%3c")<>0 or InStr(namewithpass,"<")<>0 or InStr(namewithpass,"%3e")<>0 or InStr(namewithpass,">")<>0 or InStr(namewithpass,"%28")<>0 or InStr(namewithpass,"(")<>0 or InStr(namewithpass,"%29")<>0 or InStr(namewithpass,")")<>0 then
response.write "<script language=JavaScript>{window.alert('请不要输入非法字符!');window.history.go(-1)}</script>"
Response.End
end if

set rs=server.createobject("adodb.recordset")
sql="select * from huiyuan where huiyuan='"&huiyuanname&"'"
rs.open sql,conn,3,3
if rs.recordcount>0 then
response.write "<script language=JavaScript>{window.alert('此会员帐号已经注册!');window.history.go(-1)}</script>"
response.end
else
'发注册信
if request.form("mail")<>"" then
html="<html><head><title>感谢您的注册</title><meta http-equiv=Content-Type content=text/html; charset=gb2312></head><body bgcolor=#FFFFFF text=#000000>"
html=html&"亲爱的"&request("huiyuan")&",您好！<br><br>　 欢迎注册为会员。<br>"
html=html&"　 会员账号："&request.form("huiyuan")&"<br>"
html=html&"　 会员密码："&request.form("password")&"<br>"
html=html&"<br><br></body></html>"
email = request.form("mail")
bt = ""&huiyuan&"会员注册成功"
if my_mailto="0" then
smtp email,bt,html
elseif my_mailto="1" then
jmail email,bt,html
end if
end if
'发信结束
session("huiyuan")=huiyuanname
Response.Cookies("lgcookie")("username") = huiyuanname
Response.Cookies("lgcookie")("password") = huiyuanpass
Response.Cookies("lgcookie")("userclass") = "小精灵"
Response.Cookies("lgcookie").Expires = Now()+365
'添加一个用户到数据库
rs.addnew
rs("huiyuan")=huiyuanname
rs("password")=huiyuanpass
rs("name")=nohack(request.form("name"))
rs("xb")=nohack(request.form("xb"))
rs("dz")=nohack(request.form("TPL_prov"))&nohack(request.form("TPL_city"))&nohack(request.form("dz"))
rs("ip") = Request.servervariables("REMOTE_ADDR")
rs("yb")=nohack(request.form("yb"))
rs("tel")=nohack(request.form("tel"))
rs("mail")=nohack(request.form("mail"))
rs("logins")=1
rs("userclass")="小精灵"
Rs("article")=0
Rs("lastlogin")=NOW()
Rs("lockuser")=0
rs("jifen")=200
rs.update
rs.close
set rs=nothing
Response.redirect "zhuce-4.asp"
end if %>
<!--#include file="inc_end.asp" -->