连不到index.asp这是为什么阿 哪里的问题呢

lvjie630 2007-06-05 10:18:11
<!--#include file = "include/conn.asp"-->
<!--#include file = "include/md5.asp"-->
<!--#include file = "include/config.asp"-->
<%
if NOT isempty(request("LoginSubmit")) then
dim username,password,passcode

username = checkStr(trim(Request.Form("username")))
password = md5(checkStr(trim(Request.Form("password"))))
passcode = checkStr(trim(Request.Form("passcode")))

if username="" or password="" then
call MsgBox("对不起,登录失败,请检查您的登录名和密码","back","None")
end if

if not isnumeric(validatecode) then
call msgbox("登录失败!验证码必须是数字,请正确填写!","back","none")
end if

if Trim(Session("wwwtoot.com_ValidateCode"))<>Trim(Request.Form("validatecode")) then
call msgbox("登录失败!验证码错误!","back","none")
end if

set rs=server.CreateObject("adodb.recordset")

rs.Open "select * from [table_user] where username='"&username&"' and password='"&password&"' " ,conn,1,3

if not(rs.bof and rs.eof) then
if password=rs("password") then
response.Cookies(cookieName)("username")=trim(request("username"))
response.Cookies(cookieName)("vip")=rs("vip")
rs("lastvst")=now()
rs("loginnum")=rs("loginnum")+1
rs.Update
rs.Close
set rs=nothing
response.redirect "index.asp"

else
call MsgBox("对不起,您的用户名或密码有误!","Back","None")
end if
else
call MsgBox("对不起,您的用户名或密码有误!","Back","None")
end if

end if


%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>login</title>
<link href="css/style.css" rel="stylesheet" type="text/css" /><style type="text/css">body {
margin-top: 150px;
}
</style>
</head>

<body>
<form name="loginform" action="" method="post">
<table width="333" height="216" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="image/daohangbeijing.gif"><table width="333" height="261" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="106"><table width="333" height="106" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="80"> </td>
</tr>
<tr>
<td height="26" align="center" valign="bottom" class="ziti-bai">         如果您是本站会员,请在此登陆!</td>
</tr>
</table></td>
</tr>
<tr>
<td height="155" align="center" valign="top"><table width="200" height="130" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="110" colspan="4" align="right" valign="top"><table width="160" height="75" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50" height="25" align="right" class="ziti-bai">用户名:</td>
<td align="left">
<label>
<input name="username" type="text" class="input3" />
</label> </td>
</tr>
<tr>
<td width="50" height="25" align="right" class="ziti-bai">密码:</td>
<td align="left"><input name="password" type="password" class="input3" /></td>
</tr>
<tr>
<td width="50" height="25" align="right" class="ziti-bai">验证码:</td>
<td align="left"><input name="validatecode" type="text" class="input4" /> <img src="include/validatecode.asp"> </td>
</tr>
</table>
<table width="160" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="40" align="center"><table width="150" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" class="ziti"><input onClick="return check();" type="image" value="botton" src="image/daohanglogin.gif" width="150" height="30"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="40" height="20" align="right" class="ziti"> </td>
<td width="60" align="left" valign="bottom" class="ziti"><a href="members/user_reg.asp" class="ziti-bai"><font color="#FFFFFF">用户注册</font></a></td>
<td width="90" align="right" valign="bottom" class="ziti"><a href="#" class="ziti-bai"><font color="#FFFFFF">找回密码</font></a></td>
<td width="10" align="right" class="ziti"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function check()
{
if(checkspace(document.loginform.username.value)) {
document.loginform.username.focus();
alert("用户名不能为空!");
return false;
}
if(checkspace(document.loginform.password.value)) {
document.loginform.password.focus();
alert("密码不能为空!");
return false;
}
if(checkspace(document.loginform.validatecode.value)) {
document.loginform.validatecode.focus();
alert("验证码不能为空!");
return false;
}
document.loginform.submit();
}

document.loginform.username.focus();
//-->
</script>
...全文
156 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lvjie630 2007-06-05
  • 打赏
  • 举报
回复
如果登陆成功,就转到index.asp页面,可是现在不行
cow8063 2007-06-05
  • 打赏
  • 举报
回复
不明你什么意思
lianghaitao2007 2007-06-05
  • 打赏
  • 举报
回复
是这个action="" 的原因吗??
刚学,不太懂!!!!!
snlixing 2007-06-05
  • 打赏
  • 举报
回复
你的代码没什么问题,看看是不是楼上说的那样
dingmin 2007-06-05
  • 打赏
  • 举报
回复
确认你的index.asp页面和当前页面是否在同意目录下?????


换成 response.redirect "../index.asp" 看看?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧