Dreamweaver做一个登陆页面,只一个用户,密码输入后能直接到指定页面

需要检测用户和密码是否正确,已指定了用户名demo密码demo321
,还需检测空白未填,而填上用户和密码后,直接转到指定的链接页面,不用数据库也不用ASP,我只想在页面里加上一段JAVAscript就能完成, 知道的朋友帮忙一下,成功解决再补50分以表谢意
回答不了问题的不要进来乱占位置啊!

现给你写了一个,直接就可以用!

希望对你有帮助!给个好评吧

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script>
function checkLogon(){
var name = document.getElementById("username").value;
var pass = document.getElementById("password").value;
//判断非空
if((name==null || name=="") || (pass==null || pass=="")){
alert("用户名或密码不能为空!!");
}
else{
if(name=="demo" && pass=="demo321"){
alert("登录成功!");
//这里写你页面跳转的语句
window.location.href="http://www.baidu.com/";
}
else{
alert("用户名或密码错误!!");
}
}
}
</script>
</head>

<body>
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">用户名</td>
<td><input name="textfield" type="text" size="14" id="username"></td>
</tr>
<tr>
<td height="25">密码</td>
<td><input name="textfield2" type="text" size="14" id="password"></td>
</tr>
<tr>
<td height="25" colspan="2"><div align="center">
<input type="submit" name="Submit" value="登录" onClick="checkLogon()">
</div></td>
</tr>
</table>
</body>
</html>
温馨提示:内容为网友见解,仅供参考
第1个回答  2010-04-26
不用ASP,不用数据库,做用户登录验证不安全,因为用户名和密码都要存储在客户端的网页中。除非你只是想练习JS玩玩
第2个回答  2010-04-26
你先点击登录按钮~
再在下面链接的地方添加
你要进入那个页面的ASP页面啊!
就直接进入到制指定的页面了 啊!
相似回答