<!--#include file="mdb.asp"-->
<!--#Include File="Check_hx.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="Inc/format.asp"-->
<%
dim UserName,FoundErr,ErrMsg
UserName=trim(request.form("UserName"))
if UserName="" or strLength(UserName)>10 or strLength(UserName)<4 then
	founderr=true
	errmsg=errmsg & "<br><li>请输入用户名(不能大于10小于4字符)</li>"
else
  	if not checkname(UserName) then
		errmsg=errmsg+"<br><li>用户名中含有非法字符</li>"
		founderr=true
	end if
end if
if badReg<>"" then
badwords=split(badReg,"|")
for z=0 to ubound(badwords)
if instr(UserName,badwords(z))>0 then
founderr=true
errmsg=errmsg+"<br><li>你的用户名含有网站禁止注册的字词</li>"
exit for
end if
next
end if
if founderr=false then
	dim sqlCheckReg,rsCheckReg
	sqlCheckReg="select * from [User] where UserName='" & Username & "'"
	set rsCheckReg=server.createobject("adodb.recordset")
	rsCheckReg.open sqlCheckReg,conn,1,1
	if not(rsCheckReg.bof and rsCheckReg.eof) then
		founderr=true
		errmsg=errmsg & "<br><li>亲爱的朋友，“<font color=red>" & UserName & "</FONT>”已经被注册！请换一个用户名再试试！</li>"
	else
	end if
	rsCheckReg.close
	set rsCheckReg=nothing
end if		
%>
<html>
<head>
<title>检查用户名</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="skin/1/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<br>
<%
if founderr=false then
	call Success()
else
	call WriteErrmsg()
end if
%>
</body>
</html>
<%
sub WriteErrMsg()
    response.write "<table align='center' width='100%' border='0' cellpadding='0' cellspacing='0' class='border' bgColor='#FFFFFF'>"
    response.write "<tr><td align='center' height='34' class='a1'>错误提示</td></tr>"
    response.write "<tr><td align='left' height='100'><font color=red>" & errmsg & "</font><p align='center'>【<a href='javascript:onclick=window.close()'>关 闭</a>】<br></p></td></tr>"
	response.write "</table>" 
end sub

sub Success()
    response.write "<table align='center' width='100%' border='0' cellpadding='0' cellspacing='0' class='border' bgColor='#FFFFFF'>"
    response.write "<tr><td align='center' height='34' class='a1'>恭喜你！</td></tr>"
    response.write "<tr><td align='center' height='100'><br>亲爱的朋友，“<font color=red>" & UserName & "</font>”尚未被人使用，赶紧注册吧！<p align='center'>【<a href='javascript:onclick=window.close()'>关 闭</a>】<br></p></td></tr>"
	response.write "</table>" 
end sub
%>

