请高手帮我写怎么个ASP代码啊。。

来源:百度知道 编辑:UC知道 时间:2024/06/04 04:33:23
在index.asp需要用户名和验证码0000登陆。。验证码是固定的。登陆成功后到达index2.asp

当用户AAA登陆成功时,弹出对话框:用户AAA您好,使用验证码0000登陆成功

当用户BBB登陆成功时,弹出对话框:用户BBB您好,使用验证码0000登陆成功

如果验证码不正确,则提示:您的输入有误!并返回index.asp

index1.asp
<form name="form1" method="post" action="index2.asp" onsubmit="return checkthisForm()">
用户:<input type=text name=user><br>
密码:<input type=password name=pass><br>
验证:<input type="text" name="checkcode">
<input type=submit value='登录'>
</form>
<script>
function checkthisForm(){
if(form1.checkcode.value=="" || form1.checkcode.value==null || form1.checkcode.value!="0000" ){
alert("您的输入有误");
return false;
}
return true;
}
</script>

index2.asp
<%
Username=request("user")
checkcode=request("checkcode")
if checkcode="0000" then
response.write "<script>alert('用户"&Username&"您好,使用验证码0000登陆成功
');</script>"
else