夏目友人帐的歌曲音版:网页高手进来一下啦!!!啦 啦!!!

来源:百度文库 编辑:高考问答 时间:2024/04/26 07:19:54
<!--#include file="conn.asp"-->
<%
dim rs
id1=request.form("id")
pw1=request.form("pw")
set rs=server.createobject("adodb.recordset")
rs.open "select * from admin where username='" & id1 & "'",conn,1,1
if pw1<>rs("passwd") then
response.write "<link href='css.css' type='text/css' rel='stylesheet'>"
response.write "<body bgcolor='#ffffef'>"
response.write "SORRY!请输入正确的管理员密码!!"
else
session("username")=rs("username")
session("KEY")=rs("key")
response.redirect "m.asp"
end if
rs.close
%>

上面这段代码如果在帐号正确的情况下会有response.write出来。。。
帐号错了就会出现http 500 内部服务器出错
这是怎么回事啊???谢谢大家告诉我!!!!!!!

那你没有写如果错误了就返回到什么页面啊

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("username"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="guanli.asp"
MM_redirectLoginFailed="jinggao.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_conn_STRING
MM_rsUser.Source = "SELECT username, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM 管理员 WHERE username='" & Replace(MM_valUsername,"'","''") &"' AND password='" & Replace(Request.Form("password"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<!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>
<style type="text/css">
<!--
body {
background-image: url(bg.jpg);
}
.tt {
border: 1px solid #999999;
background-color: #CCCCCC;
}
-->
</style>
</head>

<body>
<form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
<table width="250" border="1" align="center" cellpadding="1" cellspacing="1">
<tr>
<th colspan="2" scope="col">管理登陆</th>
</tr>
<tr>
<td width="80">用户名:</td>
<td><label>
<div align="center">
<input name="username" type="text" class="tt" id="username" size="20" maxlength="20" />
</div>
</label></td>
</tr>
<tr>
<td>密码:</td>
<td><div align="center">
<input name="password" type="password" class="tt" id="password" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td colspan="2"><label>
<div align="center">
<input type="submit" name="Submit" value="登陆" />
</div>
</label></td>
</tr>
</table>
</form>
<table width="650" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<!--#include file="wei.html"-->
</tr>
</table>
</body>
</html>
这个是我写的一个登陆页,用DW生成的