Crash1hd
02-14-2003, 09:14 PM
I am having trouble with the following useing access database and this code so that when the user logs in it goes through as long as they have confirmed email registration but if they havent then it stops them from entering for some reason it still alows them to enter the site as long as the login name and password are valed like its ignoring the first if then statement
'************************************ MAIN PROGRAM
If Request.Cookies("login") = "OK" Then Response.Redirect("members.asp")
submitnumber = submitnumber + 1
If username <> "" AND pass <> "" Then
Call OpenConnection()
Dim Member1Query
Dim Member2Query
Member1Query = "SELECT * FROM members WHERE confirmed = True"
Member2Query = "SELECT username, pass, confirmed FROM members WHERE username = '" & SQLFormat(Left(username,255)) & "' AND pass = '" & SQLFormat(Left(pass,255)) & "
Set RS1 = Conn.Execute(Member1Query)
Set RS2 = Conn.Execute(Member2Query)
If NOT RS1.EOF Then
If NOT RS2.EOF Then
Response.Cookies("login") = "OK"
Response.Redirect("members.asp")
Else
Call DisplayLoginForm()
End If
Else
Call Response.Redirect("Register.asp")
End If
Call CloseConnection()
Else
Call DisplayLoginForm()
End If
'******************************** END MAIN PROGRAM
'************************************ MAIN PROGRAM
If Request.Cookies("login") = "OK" Then Response.Redirect("members.asp")
submitnumber = submitnumber + 1
If username <> "" AND pass <> "" Then
Call OpenConnection()
Dim Member1Query
Dim Member2Query
Member1Query = "SELECT * FROM members WHERE confirmed = True"
Member2Query = "SELECT username, pass, confirmed FROM members WHERE username = '" & SQLFormat(Left(username,255)) & "' AND pass = '" & SQLFormat(Left(pass,255)) & "
Set RS1 = Conn.Execute(Member1Query)
Set RS2 = Conn.Execute(Member2Query)
If NOT RS1.EOF Then
If NOT RS2.EOF Then
Response.Cookies("login") = "OK"
Response.Redirect("members.asp")
Else
Call DisplayLoginForm()
End If
Else
Call Response.Redirect("Register.asp")
End If
Call CloseConnection()
Else
Call DisplayLoginForm()
End If
'******************************** END MAIN PROGRAM