username=request("name")
set rs=conn.execute("select id from tablename where fieldname='&username&"'")
if rs.eof and rs.bof then
response.redirect "2.asp"
else
response.redirect "1.asp"
end if
先在数据库里检索一下有没有该名称,有则去1.asp,没有就去2.asp
Exp:
Set Rst=server.createobject("adodb.recordset")
rst.open "select id from tablename where username='"&request.form("username")&"'",conn,2,3
if rst.eof then
response.redirect("2.asp")
else
response.redirect("1.asp")
end if
sql="select * from table where name="&request("name")
set conn=myconn.execute(sql)
if conn.eof then
response.write"<a href='2.asp'>"进入</a>
else
response.write"<a href='1.asp'>进入</a>
set rs=conn.execute("select id from tablename where fieldname='&trim(request("username"))&"'")
if rs.eof and rs.bof then
response.redirect "2.asp"
else
response.redirect "1.asp"
end if