帮偶看看这个ASP的LOGIN.ASP有什么错误啊....30分.
首先conn.asp,siteconfig.asp,top.asp,bottom.asp,md5.asp这几个程序肯定是 没有问题.并且我的IIS也运行正常,别的页都可以显示,但就这个页,只说500内部服务器错误,偶把IIS的调试的报错功能也打开了,但就是不出现详细的错误,大家帮我看看啊,哪儿错了.....
login.asp文件源码如下
<!--#include file="conn.asp"-->
<!--#include file="siteconfig.asp"-->
<%
dim action,comeurl
action=request.QueryString("action")
comeurl=Request.ServerVariables("HTTP_REFERER")
%>
<Script language="JavaScript">
<!--
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function checkuser()
{
if(checkspace(document.userinfo.username.value)) {
document.userinfo.username.focus();
alert("用户名不能为空!");
return false;
}
if(checkspace(document.userinfo.password.value)) {
document.userinfo.password.focus();
alert("密码不能为空!");
return false;
}
}
//-->
</Script>
<html>
<head><title><%=sitename%>--用户登录</title>
<head>
<body leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="top.asp"-->
<%select case action
case ""%>
<table width="776" border="0" cellpadding="0" cellspacing="0" bgcolor="#D0E2FD">
<tr>
<td>
<form name="userinfo" action="login.asp?action=checkuser" method="post"align="center">
用户名:<input name="username" type="text" size="20"> <a href="reg.asp">还没注册?</a><br>
密 码:<input name="password" type="password" size="20"> <a href="lostpass.asp">忘记密码?</a><br>
<input name="Submit" onClick="return checkuser();" type="submit" value="登录系统">
<input name="reset" type="reset" value="重新输入"
</form>
</td>
</tr>
</table>
<%case "checkuser"%>
<!--#include file="md5.asp"-->
<%
dim username,password,comeurl
username=replace(trim(request("username")),"'","")
password=md5(replace(trim(request("password")),"'",""))
if trim(request("comeurl"))="" then
comeurl="default.asp"
else
comeurl=trim(request("comeurl"))
end if
if username="" or password="" then
call loginerr()
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from book_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("book")("username")=trim(request("username"))
response.Cookies("book").expires=date+1
rs("logins")=rs("logins")+1
rs.Update
rs.Close
set rs=nothing
call loginok()
else
response.write "<script LANGUAGE='javascript'>alert('对不起,您的用户名或密码有误!');window.location.reload('javascript:history.go(-1)')</script>"
end if
else
response.write "<script LANGUAGE='javascript'>alert('对不起,您的用户名或密码有误!');window.location.reload('javascript:history.go(-1)')</script>"
end if
%>
<%end selcet%>
<%
sub loginerr()
response.Write "<center><a href=login.asp><font color=red size=2>对不起,登陆失败,请检查您的登陆名和密码</font></a></center>"
response.end
end sub
sub loginok()
response.Write "<font size=2>欢迎您 <font color=red size=2>"&request.Cookies("book")("username")&"</font>,两秒种后将自动跳转到相应页!</font>"
response.Write "<meta http-equiv=refresh content=2;URL="&comeurl&">"
end sub
%>
<!--#include file="bottom.asp"-->
login.asp文件源码如下
<!--#include file="conn.asp"-->
<!--#include file="siteconfig.asp"-->
<%
dim action,comeurl
action=request.QueryString("action")
comeurl=Request.ServerVariables("HTTP_REFERER")
%>
<Script language="JavaScript">
<!--
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function checkuser()
{
if(checkspace(document.userinfo.username.value)) {
document.userinfo.username.focus();
alert("用户名不能为空!");
return false;
}
if(checkspace(document.userinfo.password.value)) {
document.userinfo.password.focus();
alert("密码不能为空!");
return false;
}
}
//-->
</Script>
<html>
<head><title><%=sitename%>--用户登录</title>
<head>
<body leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="top.asp"-->
<%select case action
case ""%>
<table width="776" border="0" cellpadding="0" cellspacing="0" bgcolor="#D0E2FD">
<tr>
<td>
<form name="userinfo" action="login.asp?action=checkuser" method="post"align="center">
用户名:<input name="username" type="text" size="20"> <a href="reg.asp">还没注册?</a><br>
密 码:<input name="password" type="password" size="20"> <a href="lostpass.asp">忘记密码?</a><br>
<input name="Submit" onClick="return checkuser();" type="submit" value="登录系统">
<input name="reset" type="reset" value="重新输入"
</form>
</td>
</tr>
</table>
<%case "checkuser"%>
<!--#include file="md5.asp"-->
<%
dim username,password,comeurl
username=replace(trim(request("username")),"'","")
password=md5(replace(trim(request("password")),"'",""))
if trim(request("comeurl"))="" then
comeurl="default.asp"
else
comeurl=trim(request("comeurl"))
end if
if username="" or password="" then
call loginerr()
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from book_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("book")("username")=trim(request("username"))
response.Cookies("book").expires=date+1
rs("logins")=rs("logins")+1
rs.Update
rs.Close
set rs=nothing
call loginok()
else
response.write "<script LANGUAGE='javascript'>alert('对不起,您的用户名或密码有误!');window.location.reload('javascript:history.go(-1)')</script>"
end if
else
response.write "<script LANGUAGE='javascript'>alert('对不起,您的用户名或密码有误!');window.location.reload('javascript:history.go(-1)')</script>"
end if
%>
<%end selcet%>
<%
sub loginerr()
response.Write "<center><a href=login.asp><font color=red size=2>对不起,登陆失败,请检查您的登陆名和密码</font></a></center>"
response.end
end sub
sub loginok()
response.Write "<font size=2>欢迎您 <font color=red size=2>"&request.Cookies("book")("username")&"</font>,两秒种后将自动跳转到相应页!</font>"
response.Write "<meta http-equiv=refresh content=2;URL="&comeurl&">"
end sub
%>
<!--#include file="bottom.asp"-->
...全文
相关推荐
ASP.NET简单LOGIN控件实例
例如,`LoggedIn`事件可以用来更新用户会话状态,`LoginError`事件则可以显示更具体的错误信息。总结起来,ASP.NET的Login控件提供了一种直观且方便的方式来实现用户登录功能。
asp.net login控件 使用详解说明
ASP.NET Login控件是.NET Framework中用于用户身份验证的一个强大工具,它简化了网页应用程序的登录功能实现。
asp.net用户注册登录模块Login源码
**登录控件(Login Control)** ASP.NET提供了一个预定义的Login控件,使得在页面上添加登录功能变得简单。这个控件包含了用户名、密码输入框以及登录按钮,并能自动处理登录逻辑。
asp模拟登录记录login-支持中文(utf-8)_asp_
在“login-支持中文用户版”这个项目中,我们可以推断出该压缩包包含了一个专门针对中文用户名的登录系统实现。首先,我们要理解ASP中的登录过程。在ASP中,登录通常涉及以下几个关键步骤:1.
login_asp.rar_WEB开发_ASP_
【login_asp文件分析】"login_asp"文件名表明这是一个与用户登录相关的ASP文件。可能包含了以下关键元素:1.


