我已经使用 ASP 经典创建了一个登录页面。
问题是登录后它重定向到具有相同登录和注册按钮的索引页面,而不是显示用户名或电子邮件ID?
提前致谢...
这是代码(VBScript)。
<%
email = ""
password = ""
ErrorMessage = ""
if request.form <> "" then
email = Request.Form("email")
password = Request.Form("password")
if email = "" or password = "" then
ErrorMessage = "You must specify a username and password."
else
set conn = Server.CreateObject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open("F:\main\main\App_Data\Users.mdb")
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "Select * FROM Login WHERE Email = '" & email & "'", conn
response.write("email")
if rs.EOF = false then
if rs.fields("Password") = password then
Response.Redirect("indexs.asp")
end if
end if
ErrorMessage = "Login failed"
end if
end if
if ErrorMessage <> "" then
response.write("<p>" & ErrorMessage & "</p>")
response.write("<p>Please correct the errors and try again.</p>")
end if
%>