JoeM6
Programmer
I got this login script from a website. When I test it, it says that the login.asp page cannot be found. The script goes like this:
<%@ Language=VBScript %>
<% Response.Buffer = True %>
<HTML>
<BODY>
<%
UserName = Request.Form("username"
Password = Request.Form("password"
'grab the form contents
Set MyConn=Server.CreateObject("ADODB.Connection"
MyConn.Open "your connection string here"
SQL = "Select UserName, Password From tblLogin " _
& "Where UserName = '"&UserName&"' And Password = '"&Password&"'"
Set RS = MyConn.Execute(SQL)
If Not RS.EOF Then
Session("allow" = True
'if there is a match then show the page
%>
Put the contents of your page here.
<%
Else
Response.Redirect "password1.html"
RS.Close
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
End If
%>
'if there was no match then make the visitor try again to login.
</BODY>
</HTML>
What else do I have to change?
(Note, the name of the database file is tblLogin.mdb)
JoeM6
JPMJR11@aol.com
<%@ Language=VBScript %>
<% Response.Buffer = True %>
<HTML>
<BODY>
<%
UserName = Request.Form("username"
Password = Request.Form("password"
'grab the form contents
Set MyConn=Server.CreateObject("ADODB.Connection"
MyConn.Open "your connection string here"
SQL = "Select UserName, Password From tblLogin " _
& "Where UserName = '"&UserName&"' And Password = '"&Password&"'"
Set RS = MyConn.Execute(SQL)
If Not RS.EOF Then
Session("allow" = True
'if there is a match then show the page
%>
Put the contents of your page here.
<%
Else
Response.Redirect "password1.html"
RS.Close
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
End If
%>
'if there was no match then make the visitor try again to login.
</BODY>
</HTML>
What else do I have to change?
(Note, the name of the database file is tblLogin.mdb)
JoeM6
JPMJR11@aol.com