hi there
I am trying to create a login page where if the user is a first time user then i wanna make them change their password. if they type in the wrong user name or password i want to alert them that they have entered the wrong details.
If everything is correct, then i want to log them in.
I have a problem with the following code:
Set RS = Server.CreateObject("ADODB.Recordset"
sql = "SELECT * FROM stafflogin WHERE username = '"&user&"' AND Password = '"&password&"' AND accessed = 'Yes'"
RS.Open (sql), myconn', adOpenStatic
If not RS.EOF Then
Response.cookies(user).expires = date+1
Response.write "You are logged in as "& user
Else
if rs.eof then
Response.write "you are loggin in for the first time please change your password"
else
response.write "Invalid Login"
end if
End If
Conn.close
Set Conn = Nothing
I would appreciate it if anyone could correct my code or send me some new code.. i have a deadline for tonite!!!
Many thanx.
I am trying to create a login page where if the user is a first time user then i wanna make them change their password. if they type in the wrong user name or password i want to alert them that they have entered the wrong details.
If everything is correct, then i want to log them in.
I have a problem with the following code:
Set RS = Server.CreateObject("ADODB.Recordset"
sql = "SELECT * FROM stafflogin WHERE username = '"&user&"' AND Password = '"&password&"' AND accessed = 'Yes'"
RS.Open (sql), myconn', adOpenStatic
If not RS.EOF Then
Response.cookies(user).expires = date+1
Response.write "You are logged in as "& user
Else
if rs.eof then
Response.write "you are loggin in for the first time please change your password"
else
response.write "Invalid Login"
end if
End If
Conn.close
Set Conn = Nothing
I would appreciate it if anyone could correct my code or send me some new code.. i have a deadline for tonite!!!
Many thanx.