ASP密码进入问题!

来源:百度知道 编辑:UC知道 时间:2024/06/21 01:31:52
<html>
<head><TITLE>例3.13if…then…else结构</TITLE>
<script language="VBScript">
dim dan,hd
mm="123456"
hd=inputbox("请输入你的密码:")
</script>
</head>
<BODY>
<script language="VBScript">
if hd<>mm then
alert("你的密码不正确!")
else
alert("欢迎你的光临!")
end if
</script>
</BODY>
<a href="D:\课程表.htm">请单击这里链接到课程表</a>
</html>
以上代码无论输入密码正确与否都能进入到正确的一边,即出现进入到课程表的连接。怎样修改才能让当密码输入错误时,出现提示,然后不进入到课程表连接???

<html>
<head><TITLE>例3.13if…then…else结构</TITLE>
<script language="VBScript">
dim dan,hd
mm="123456"
hd=inputbox("请输入你的密码:")
</script>
</head>
<BODY>
<script language="VBScript">
if hd<>mm then
alert("你的密码不正确!")
else
alert("欢迎你的光临!")
document.write ("<a href=""D:\课程表.htm"">请单击这里链接到课程表</a> ")
end if
</script>
</BODY>
</html>

你那不是ASP,把下面的复制建立个文件自己测试下:

<%
If request.QueryString("action")="pass" Then

dim dan,hd
mm="123456"
hd = Request.Form("mm")
if hd <> mm then
Response.Write ("<script>alert(' 你的密码不正确!');javascript:history.back();</script>")
Response.End
els