<!--#include file="../Include/Class_Conn.asp" -->
<% 
dim action,values,rs
action=replace_text(request.querystring("action"))
values=replace_text(request.querystring("value"))
set rs=server.createobject("ADODB.recordset")
set re=server.createobject("ADODB.recordset")
select case action
 case "cusername"
  call cusername() '//检测用户名
 case "cuseremail"
  call cuseremail() '//检测邮件
end select

sub cusername()
 rs.open "select username from [pH_Person_Base] where username='"&values&"'",conn,1,1
 if rs.eof then
   CloseRs
   CloseDB
   response.write "<b>恭喜！您可以使用这个用户名</b>"
   response.write "<script>alert('-恭喜！您可以使用这个用户名-');window.close();</script>"
   response.End()
 else
   CloseRs
   CloseDB
  response.write "<b>抱歉！您不能使用这个用户名</b>"
  response.write "<script>alert('-抱歉！您不能使用这个用户名-');window.close();</script>"
  response.End()

 end if

End sub




sub cuseremail()
 rs.open "select useremail from [pH_Person_Base] where useremail='"&values&"'",conn,1,1
 if rs.eof then
   CloseRs
   CloseDB
    response.write "<b>该邮箱没有被使用，可以注册！</b>"
    response.write "<script>alert('-该邮箱没有被使用，可以注册！-');window.close();</script>"
    response.End()
 Else
   CloseRs
   CloseDB
  response.write "<b>该邮箱已经被使用，不能注册！</b>"
  response.write "<script>alert('-该邮箱已经被使用，不能注册！-');window.close();</script>"
  response.End()

 end if
end sub
 %>
