ASP+ACCESS
注册用户时有个人和商家两个会员模式。
现在的问题是,比如 个人会员已经注册了12345这个用户,在商家会员还能再注册一次,注册后个人会员发布的信息,在商家里面可以删除个人会员里面相同会员名字的信息。如果会员多了,难免有重名的,那样网站就乱套了。
请问怎样才能做到在注册用户名时,同时检测jle_user 和jle_com这两个表中会员是否已经被注册??现在的代码只检测一个里面的。另一个不检测
---------------------------------------------------------------------------------------
<%
dim k,per,password1
per=Request.form("per")
username=Request.form("username")
if nothaveChinese(username)=false then
response.write "<script language=JavaScript>" & chr(13) & "alert('用户名不能是中文!');" & "history.back()" & "</script>"
end if
password=Request.form("password")
password1=Request.form("password1")
set rs=server.createobject("adodb.recordset")
sql="select username from [jle_com] where username='"&username&"' "
rs.open sql,conn,1,1
if not rs.eof or not rs.bof then
if trim(rs("username"))=username then
sql="select username from [jle_user] where username='"&username&"' "
if not rs.eof or not rs.bof then
if trim(rs("username"))=username then
response.write "<script language=JavaScript>" & chr(13) & "alert('您输入的用户名已经注册过,请重新注册com');" & "history.back()" & "</script>"
response.write "<script language=JavaScript>" & chr(13) & "alert('您输入的用户名已经注册过,请重新注册per');" & "history.back()" & "</script>"
end if
end if
else
response.write "<script language=JavaScript>" & chr(13) & "alert('您输入的用户名已经注册过,请重新注册per');" & "history.back()" & "</script>"
response.end
end if
response.write "<script language=JavaScript>" & chr(13) & "alert('未知错误');" & "history.back()" & "</script>"
response.end
end if
rs.close
set rs=nothing
%>