就是登陆的时候 两个单选按钮
如果选择的是个人的话 从数据库的表1中读取数据
如果选择的是企业的话 从数据库的表2中读取数据
这个怎么写 望给指点下 谢谢
还是只能用一个表里登陆
<input name="typ" type="radio" value="client" checked>个人
<input type="radio" name="typ" value="vip">企业
验证代码:
<%
Dim login_name,password1,yz
if Request.QueryString("act")="login" then
login_name=Replace(Request.Form("login_name")," ","+++ close")
password1=Replace(Request.Form("password1")," ","+++ close")
If login_name<>"" and password1<>"" Then
If not IsNumeric(Request.Form("yz")) Then
Response.Write "<script>alert('你输入的验证码为非数字!');window.location.href('member.asp');</script>"
Response.End
End If
If (int(Session("SafeCode"))=int(Request.Form("yz"))) Then
typ=request("typ") ’这样对不对啊?
if typ="client" then
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data.mdb")
set rs=server.createobject("adodb.recordset")
sql="Select * from register where login_name='"&login_name&"' and password1='"&password1&"'"
rs.open exec,conn,1,1
else
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data.mdb")
set rs=server.createobject("adodb.recordset")
sql="Select * from regvip where login_name='"&login_name&"' and password1='"&password1&"'"
rs.open exec,conn,1,1
end if
If not(rs.bof and rs.eof) Then
If password1=rs("password1") and login_name=rs("login_name") Then
Session("login_name")=rs("login_name")
rs.close
Set rs=nothing
Response.Redirect "login.asp"
Else
Response.Write "<script>alert('登陆失败,用户名或密码错误!');window.location.href('member.asp');</script>"
End If
Call EndConnection()
Else
Response.Write "<script>alert( '登陆失败!用户名或密码不存在!');window.location.href('member.asp');</script>"
End If
Call EndConnection()
Else
Response.Write "<script>alert('登陆失败!验证码输入错误!');window.location.href('member.asp');</script>"
End If
Else
Response.Write "<script>alert('登陆失败!用户名和密码不能为空!');window.location.href('member.asp');</script>"
End If
End If
%>