日期:2014-05-17  浏览次数:20910 次

ASP选择登录方式如何实现?
就是在同一个登录窗口输入用户名和密码或者输入卡号和密码都可以登录。例如:表名为user,含字段username,userpwd,cardid,cardpwd.如何实现,谢谢!

------解决方案--------------------
分别判断2次是必须的。
从表里搜索符合username和userpwd的记录
再从表里搜索符合cardid和cardpwd的记录

或者在登录框边上加个卡号登录的复选框,勾上就判断从cardid搜索登录。
------解决方案--------------------
<script language= "javascript ">
function oo()
{
//alert( "A登陆 ")
OA=document.getElementById( 'A ')
A.innerHTML= 'ooxx '
B.innerHTML= 'ooxx '
}
function xx()
{
//alert( "B登陆 ")
OA=document.getElementById( 'B ')
A.innerHTML= 'xxoo '
B.innerHTML= 'xxoo '
}
</script>
<form name= "form1 " method= "post " action= " ">
<span id =A> ooxx </span> <input type= "text " name= "username "> <br>
<span id =B> ooxx </span> <input type= "text " name= "pwd "> <br>
登陆1 <input type= "radio " name= "radiobutton " value= "1 " onClick= "oo(); "> <br>
登陆2 <input type= "radio " name= "radiobutton " value= "2 " onClick= "xx(); ">
</form>
任何数据库通吃,根据传上去的radiobutton值判断是啥登陆
------解决方案--------------------
sql= "slelect * from [表名] where (username=&username& and userpwd=&userpwd&) OR (cardid=&name& and cardpwd=&pwd&) "
其中name代表用户输入的登陆名或者卡号的变量
pwd代表用户输入的用户密码或者卡号密码的变量
执行这条查询操作~如果为空则不能登陆,如果不为空则可以登陆。