<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../checkvalid.asp" -->
<%If Not FRAdminLevel(302) Then
	Call ErrorMsg()
End If
member_login=trim(request("login"))
dim errorflag,errorstr
errorflag=0
errorstr=""
if member_login="" then
  errorflag=1
  errorstr="请输入用户名！"
else
  Function isletternumber(strng)
   isletternumber = false
   Dim regEx, Match ' Create variables.
   Set regEx = New RegExp   ' Create a regular expression object (stupid, huh?)
   regEx.Pattern = "^[A-Za-z0-9]{4,20}$" ' Sets pattern.
   regEx.IgnoreCase = True   ' Set case insensitivity.
   Set Match = regEx.Execute(strng)   ' Execute search.
   if match.count then isletternumber= true
  End Function
  if not isletternumber(member_login) then
    errorflag=1
    errorstr="用户名要求由4-20个字母或数字组成！"
  else
    set rs=server.createobject("ADODB.Recordset")
    sql="select member_login from JOB_member where member_login='"&member_login&"'"
    rs.open sql,conn,1,1
    if not rs.eof then
	  errorflag=1
      errorstr="用户名"&member_login&"已经存在，请重新选择用户名！"
	end if
	rs.close
	set rs=nothing
  end if
end if
if errorflag=1 then
  response.write("<font color=red>"&errorstr&"</font><br>")
else
  response.write("用户名"&member_login&"还未被注册，您可以使用！")
end if 
%>