<!-- #include file=conn.asp-->
<!-- #include file=config.asp -->
<!-- #include file=const.asp -->
<!-- #include file=char.asp -->
<%
 '=========================================================
' File: chkreg.asp
' Version:3.0
' Date: 2005-10-29
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
	stats="用户检查"
	dim username
	dim useremail,Splitwords
	if request("username")="" or strLength(request("username"))>20 then
		errmsg=errmsg+"<br>"+"<li>请输入您的用户名(长度不能大于20)。"
		founderr=true
	else
		username=trim(request("username"))
	end if
	if Instr(request("username"),"=")>0 or Instr(request("username"),"%")>0 or Instr(request("username"),chr(32))>0 or Instr(request("username"),"?")>0 or Instr(request("username"),"&")>0 or Instr(request("username"),";")>0 or Instr(request("username"),",")>0 or Instr(request("username"),"'")>0 or Instr(request("username"),",")>0 or Instr(request("username"),chr(34))>0 or Instr(request("username"),chr(9))>0 or Instr(request("username"),"")>0 or Instr(request("username"),"$")>0 then
	errmsg=errmsg+"<br>"+"<li>用户名中含有非法字符。"
		founderr=true
	else
		username=trim(request("username"))
	end if

	Splitwords=split(RSplitWord,",")
	for i = 0 to ubound(Splitwords)
		if instr(Username,Splitwords(i))>0 then
			errmsg=errmsg+"<br>"+"<li>您输入的用户名包含系统禁止注册字符。"
			founderr=true
			exit for
		end if
	next
	
	if IsValidEmail(trim(request("Usermail")))=false then
   		errmsg=errmsg+"<br>"+"<li>请输入您正确的Email地址。"
   		founderr=true
	else
		useremail=CheckStr((request("Usermail")))
	end if
	if not founderr then
	if cint(emailctrl)=1 then
	sql="select username,useremail from Ms_user where username='"&username&"' or useremail='"&useremail&"'"
	else
	sql="select username,useremail from Ms_user where username='"&username&"'"
	end if
	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
		if cint(emailctrl)=1 and rs("useremail")=useremail then
		errmsg=errmsg+"<br>"+"<li>对不起，本系统已经限制了一个Email只能注册一个帐号，请重新选择您的Email。"
		else
		errmsg=errmsg+"<br>"+"<li>对不起，您输入的用户名已经被注册。"
		end if
		founderr=true
	else
		founderr=false
	end if
	rs.close
	set rs=nothing
	end if
%>
<html><head>
<meta NAME=GENERATOR Content="Microsoft FrontPage 4.0" CHARSET=GB2312>
<title><%=Webname%>--<%=stats%></title>
</head>
<body topmargin="0" leftmargin="0">
<table cellpadding=3 cellspacing=1 align=center width=98%>
<TBODY> 
<TR align=middle> 
<Th height=24>用户检测情况</Th>
</TR>
<%if founderr=true then%>
<tr><td class=tablebody1 align=center>您在"<%=stats%>"的时候发生错误,下面是错误的详细信息</td></tr>
<%else%>
<tr><td class=tablebody1 align=center>您在"<%=stats%>"所检测的用户和Email可以注册！</td></tr>
<%end if%>
<TR> 
<Td class=tablebody1 height="120">
<%
if founderr then
response.Write(errmsg)
else
response.Write("恭喜，您所填写的用户和Email通过检测，可以正常注册！<br>请继续将您的注册信息填写完整，谢谢！")
end if
%></TD>
</TR>
<tr><td class=tablebody1 align="center"><a href="javascript:window.close()"> 关闭窗口</a> </td></tr>
</TBODY>
</TABLE>
<%call activeonline()%>