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
%>