<!--#include file="connoklin.asp"-->
<!--#include file="inc/md5.asp" -->
<%
if instr(request.servervariables("http_referer"),"http://"&request.servervariables("http_host") )<1 then
Response.Redirect "index.asp"
response.end()
end if%>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from reguser where username='"&trim(request("username"))&"' or email='"&trim(request("email"))&"'",conn,1,1
if rs.recordcount>0 then
  response.write "<table width=760 border=0 cellspacing=0 cellpadding=0 align=center  class=table-zuoyou><tr>  "
  response.write "<td bordercolor=#FFFFFF bgcolor=#FFFFFF align=center><table width=80% border=0 align=center cellpadding=2 cellspacing=0><tr><td class=pad><font color=#cb6f00>用户注册失败</font></td></tr><tr>"
  response.write "<td class=pad ><font color=#FF0000>·您输入的用户名或Email已存在，请返回重新输入！<br>·<a href=javascript:history.go(-1)><font color=red>点击返回上一页</font></a> </font></td></tr></table></td></tr></table>"
rs.close
else
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from reguser",conn,1,3
rs.addnew
rs("username")=trim(request("username"))
rs("password")=md5(trim(request("password")))
rs("email")=trim(request("email"))
rs("cname")=trim(request("cname"))
rs("personame")=trim(request("personame"))
rs("tel")=trim(request("tel"))
rs("addr")=trim(request("addr"))
rs.update
rs.close
set rs=nothing
response.write"<script>alert('注册成功，请等待管理员验证！');</script>"
response.write"<script>location.href='index.asp';</script>"
session("linok")=trim(request("username"))
end if
%>