在ASP中如何调用VBSCRIPT和JAVASCRIPT
高手请看这段代码:
<%@LANGUAGE= "VBSCRIPT " CODEPAGE= "936 "%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 管理员登陆 </title>
<script language= "javascript ">
function checkform(user_name,pass_word)
{
var user_name=document.getElementById( "1 ").value
var obj1= "lixiuli "
if(user_name!=obj1)
{
alert( "请正确输入您的帐号 ")
document.form.username.focus();
return false;
}
var pass_word=document.getElementById( "2 ").value
var obj2= "19880723 "
if(pass_word!=obj2)
{
alert( "请正确输入您的密码 ")
document.form.password.focus();
return false;
}
}
</script>
</head>
<body bgcolor= "bisque ">
<form name= "form " method= "post " onsubmit= "return checkform(); " action= "creatcookie2.asp " >
<table align= "center " border= "1 " cellspacing= "1 " cellpadding= "20px " width= "50% " bgcolor= "#f0ffff ">
<tr>
<td align= "center " bgcolor= "#FF9933 ">
<font face= "宋体 " size= "5 " color= "#FFFFFF ">
管理员登陆
</font>
</td>
</tr>
<tr>
<td align= "center " bgcolor= "#99CCFF ">
<font face= "宋体 " size= "4 " color= "#3333FF ">
帐号:
</font>
<input type= "text " name= "username " maxlength= "40 " id= "1 ">
</td>
</tr>
<tr>
<td align= "center " bgcolor= "#99CCFF ">
<font face= "宋体 " size= "4 "color= "#3333FF ">
密码:
</font>
<input type= "password " name= "password " maxlength= "20 " id= "2 ">
</td>
</tr>
<tr>
<td bgcolor= "#99CCFF ">
        
<input type= "submit " value= "提交 " name= "submit " >
        
        
        
        
<input type= "reset " value= "重置 " name= "my-reset " >
</td>
</tr>
</table>
</form >
</body>
</html>
我想在用JAVASCRIPT验证完表单后,满足条件的话就跳转到 "留言界面.asp ",(想用VBSCRIPT里的response.redirect来实现跳转)请问creatcookie2.asp这个页面该怎样写?
[解决办法]
在creatcookie2.asp中验证后,实现跳转可以用
window.location.href= "http://www.aaa.com "
你不会真用这个页面做登录验证吧。
把用户名和密码写在客户端脚本中,别人只要看下源码就直接登录了。