Click to See Complete Forum and Search --> : How to Implement User name, Passwords check using java script


Gerom7
06-14-2006, 12:59 PM
Is there any way that one can implement user name and login using JavaScript. If java script is not appropriate what other scripting languages are must be used. I am guessing if user names and passwords will be stored in database then it probably should be a VB script.

This is something new to me, so please, any refferences, suggestions and advices are welcomed and appreciated.


Thank you.


Igor. :confused:

lmf232s
06-14-2006, 02:36 PM
here are a couple of examples (scroll down this page to see DB examples)
http://www.asp101.com/samples/login.asp

The first example is pretty much the way it works only you would never compare the username & password values entered to a hard coded username and password.

Instead you would hit the DB for that. Maybe something like this.

sSQL = " SELECT Count(*) " & _
" FROM Users
" WHERE UserName = Replace(request.Form("txtUserName"), "'", "''") " & _
" AND Password = Replace(Request.Form("txtPassword"), "'", "''")"

set oRS1 = oConn.Execute(sSQL)
If Not oRS1.EOF then
'log in successfull
Response.Redirect "Index.asp"
Else
Response.write "User Not Found"
End If