求ASP里弹出一个警告框的代码
代码:<scriptlanguage="javascript"><%'用户登陆username=request("youxiang")password=request("...
代码:
<script language="javascript">
<%'用户登陆
username=request("youxiang")
password=request("mima")
'1)连接数据库
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open"driver={SQL Server};Server=(Local);UID=at_you;PWD=at_you;database=at_you;"
'2)打开数据表
set rs1=server.createobject("ADODB.Recordset")
sql1="select * from 用户信息 where username='"+username+"'and mima='"+password+"'"
rs1.open sql1,conn,1,3
if rs1.recordcount=1 then
if rs1("authority")="1" then
response.redirect "zhuce.html"
else
response.redirect "liulan.html"
'成功
end if
else
<!--
alert("用户名与密码不匹配!");
//-->
'失败
end if
%>
</script>
就else那里该怎么改呢 展开
<script language="javascript">
<%'用户登陆
username=request("youxiang")
password=request("mima")
'1)连接数据库
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open"driver={SQL Server};Server=(Local);UID=at_you;PWD=at_you;database=at_you;"
'2)打开数据表
set rs1=server.createobject("ADODB.Recordset")
sql1="select * from 用户信息 where username='"+username+"'and mima='"+password+"'"
rs1.open sql1,conn,1,3
if rs1.recordcount=1 then
if rs1("authority")="1" then
response.redirect "zhuce.html"
else
response.redirect "liulan.html"
'成功
end if
else
<!--
alert("用户名与密码不匹配!");
//-->
'失败
end if
%>
</script>
就else那里该怎么改呢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询