1
我在一个平台上的localhost工作。 流程是:无法访问我的服务器中的网站
- 的login.asp插入我的登录信息(用户名+密码)
中的login.asp我有这个
If Session("isAdmin") Then
Response.Redirect "../default.asp"
Else
Response.Redirect "../index.asp"
End If
虽然在服务器给我错误
处理URL时服务器发生错误。
请联系系统管理员。 如果您是系统管理员,请点击此处了解有关此错误的更多信息。
网址是/common/_loginme.asp 在这个页面的代码是:
<%
Dim username, password
username = Request.Form("username")
password = Request.Form("password")
If username = "" Then Response.Redirect "login.asp?m=Username é obrigatório."
If password = "" Then Response.Redirect "login.asp?m=Password é obrigatório."
%>
<!-- #include file="_db.asp" -->
<%
sqlLogin = "SELECT TOP 1 id, roleId, name FROM Users WHERE isActive = True AND username = '" & CleanStr(username) & "' AND password = '" & CleanStr(password) & "'"
Set RSlogin = Conn.Execute(sqlLogin)
If RSlogin.EOF Then
Rslogin.Close
Closeconn
Response.Redirect "../login.asp?m=Username ou Password incorretas."
Else
Session("isAdmin") = RSlogin("roleId") = 1
Session("LoginID") = RSlogin("id")
Session("Name") = RSlogin("name")
Rslogin.Close
Closeconn
If Session("isAdmin") Then
Response.Redirect "../default.asp"
Else
Response.Redirect "../index.asp"
End If
End If
RSlogin.Close
Closeconn
%>
<%
Function CleanStr(s)
s = Replace(s,"'","")
s = Replace(s,"<","")
s = Replace(s,">","")
s = Replace(s,";","")
CleanStr = s
End Function
%>
为什么在本地主机I运行良好,但它不是服务器?
多了一个片段,web.config中
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<remove value="Default.asp" />
<add value="Login.asp" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
谢谢我马上就试试 – KikoFHM
错误是 'ADODB.Connection error'800a0e7a' 提供程序找不到。它可能没有正确安装。 /Question/common/_db.asp,线11' 和db.asp '<% 昏暗康恩 集康恩=的Server.CreateObject( “ADODB.Connection”) 昏暗的ConnectionString %> <! - #include文件= “DB.INC” - > <% 的ConnectionString = “PROVIDER = MICROSOFT.JET.OLEDB.4.0; DATA SOURCE =” &DBPATH Conn.Open的ConnectionString 子CloseConn \t Conn.Close \t Set Conn = Nothing End Sub %' 和db.inc '<%Dim dbPath:dbPath =“\\ server.domain \ db \ db.mdb”%>' – KikoFHM
好吧,看来您应该安装数据库提供程序驱动程序。 – gpinkas