Forum Moderators: open
user = Request.Form("username")
pass = Request.Form("password")
SQL = "SELECT username, password FROM yourtable WHERE username = '" & user & "' AND password = '" & pass & "'"
set rs = conn.execute(SQL)
if rs.eof then
'--- throw error
else
rs.close()
set rs = nothing
conn.close()
set conn = nothing
response.redirect("somewhere.asp")
end if
rs.close()
set rs = nothing
conn.close()
set conn = nothing
I highly suggest you check out the W3Schools link I provided to you earlier for some in depth description about how this all works.
I was designing a cart system for a site and found a book that taught ASP by building ... a cart system! It was perfect for me because I was able to learn the language by following an example of exactly what I wanted to build.
Take a look, you may find a book that teaches by putting together exactly what you are trying to do. Most instructional books go through the steps of creating and validating logins and how to handle events based on the login.
Good luck!
Instead, perform an MD5 hash or some other one-way encryption on the password when they create their account and store the result in your database. When they come back, perform the same hash on the password they enter and compare it to the hash stored in your database. If they match, let them in.
This protects you from ever being able to know your customers' passwords and thus from liability. If the customer loses their password, generate a new temporary password and force them to change the next time they log in.