Forum Moderators: open

Message Too Old, No Replies

Login Script

Problem with Login Script

         

Shuvi

7:27 pm on Feb 3, 2004 (gmt 0)

10+ Year Member



Can anyone tell me what is wrong with this login script?

UserName = Request.Form("username")
Password = Request.Form("password")

sql = "SELECT * from Users WHERE ThruDate is Null and UserName is " & UserName
Set rs = objConn.Execute(strQuery)

if UserName = rs("UserName") then
if Password = rs("Password") then
session("IntranetUserId") = rs("UserID")
Response.Redirect("MainMenu.asp")
else
Response.Write("<p align=""center""><span class=""names"">Incorrect Password. Please try again!</span>")
end if
else
response.Write UserName
response.Write rs("UserName")
Response.Write("<p align=""center""><span class=""names"">Incorrect UserName. Please try again!</span>")
end if

f00sion

8:27 pm on Feb 3, 2004 (gmt 0)

10+ Year Member



query should be:
sql = "SELECT * from Users WHERE ThruDate is Null and UserName =" & UserName

Shuvi

8:32 pm on Feb 3, 2004 (gmt 0)

10+ Year Member



thank you!