无法访问我服务器中的网站
can't access to website in my server
我在一个平台的 localhost 工作。
流程是:
- LOGIN.ASP 输入我的登录信息(用户名+密码)
在 login.asp 我有这个
If Session("isAdmin") Then
Response.Redirect "../default.asp"
Else
Response.Redirect "../index.asp"
End If
虽然在服务器中给我错误
An error occurred on the server when processing the URL.
Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
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
%>
为什么我在本地主机上 运行 很好,但服务器却不行?
还有一个片段,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>
我在一个平台的 localhost 工作。 流程是:
- LOGIN.ASP 输入我的登录信息(用户名+密码)
在 login.asp 我有这个
If Session("isAdmin") Then
Response.Redirect "../default.asp"
Else
Response.Redirect "../index.asp"
End If
虽然在服务器中给我错误
An error occurred on the server when processing the URL.
Please contact the system administrator. If you are the system administrator please click here to find out more about this error.
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
%>
为什么我在本地主机上 运行 很好,但服务器却不行?
还有一个片段,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>