Jump to content

User Password Problems


FMMacca

Recommended Posts

Hello ASP PRO's,Im having real trouble with some new code I have. I have ASP pages and a MS Access database, when a user signs-up, they get sent their username and password to their email account, I can see in the access database that the entry is correct but when the user tries to sign in with the account they get a;Error: Invalid PasswordThe password you entered was incorrect.Obviously I've made sure the username and password is correct, but no matter what I do, no one is able to sign-in, here is the code where I think its all going wrong;

'Make sure password is correctCheckPass = Request("pwd")If LCase(Request.ServerVariables("PATH_TRANSLATED")) <> LCase(GamePath & "\members\verifylogin.asp") Then	CheckPass = Decrypt(CheckPass)End IfIf CheckPass <> Returned("Password") Then		Error "Invalid Password", "The password you entered was incorrect."End IfCheckPass = Encrypt(Returned("Password"))

Any info would be appreciated.

Link to comment
Share on other sites

You might also verify that your pages can connect to the database. The code might be functioning correctly, it just may be that your website cannot get the data from the database the way it's currently set up.

Link to comment
Share on other sites

Debug man, debug.

'Make sure password is correctCheckPass = Request("pwd")Response.Write("CheckPass: " & CheckPass & "<br>")If LCase(Request.ServerVariables("PATH_TRANSLATED")) <> LCase(GamePath & "\members\verifylogin.asp") Then  CheckPass = Decrypt(CheckPass)  Response.Write("Decrypting CheckPass<br>")Else  Response.Write("CheckPass was not decrypted<br>")End IfResponse.Write("CheckPass now: " & CheckPass & "<br>")Response.Write("Returned(Password): " & Returned("Password") & "<br>")If CheckPass <> Returned("Password") Then  Error "Invalid Password", "The password you entered was incorrect."End IfCheckPass = Encrypt(Returned("Password"))

Link to comment
Share on other sites

Thanks for the debug code justsomeguy. I used it and got the below;CheckPass: testingDecrypting CheckPassCheckPass now: ttQX5l0Returned(Password): testingError: Invalid PasswordThe password you entered was incorrect.password is EXACTLY as what is in the database!

Link to comment
Share on other sites

I believe you. Here is your problem:CheckPass now: ttQX5l0Returned(Password): testing

If CheckPass <> Returned("Password") Then

Clearly "ttQX5l0" is not the same as "testing", so that's why the message is appearing. Either do not decrypt (actually that is encrypting the password) the password, or do the same thing to the Returned("Password") that you do with the original. But if you compare the encrypted version with the original, it won't be the same.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...