| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP Login Script
I have been working on this script for logging into my website for quite some time now, and can't seem to get it working right. If anyone can help, I'd greatly appreciate it. Alright, the code is listed below:
<% username = Request.Form("username") password = Request.Form("password") Dim Conn, RS Set Conn = Server.CreateObject("ADODB.Connection") Set RS = Server.CreateObject("ADODB.Recordset") DSNStatement = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" DSNStatement = DSNStatement & Server.MapPath("Login.mdb") Conn.Open DSNStatement SQLStatement = "SELECT * FROM Login1 WHERE Username = '" & username & "' AND Password = '" & password & "' " RS.Open SQLStatement, Conn, 3, 3 RS.MoveFirst If Not RS.EOF Then Do Until RS.EOF RS.MoveNext user_Name = RS.Fields("Username").Value pass_Word = RS.Fields( "Password" ).Value If ( user_Name = username ) Then If( "password = pass_Word" ) Then Session("username") = username response.redirect( "(you have logged in page, edited out for security purposes)" ) Else response.write( "incorrect password" ) End if Else response.write( "incorrect username" ) End if Loop else response.write "No matches." end if RS.close Conn.close %> The connection always fails, and if i use on error resume next, it only gives "Incorrect Username." |
| Viewing: Tutorialized Forums > Web Design & Development > ASP > ASP Login Script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|