Skip to main content
September 21, 2009
Question

Password, Dreamweaver, PHP and mysql

  • September 21, 2009
  • 2 replies
  • 992 views

Dear,

I created a user registration for and encrypted the password using sha1

if ($pwdOK) {
        $_POST['pwd'] = sha1($_POST['pwd']);
    }

and for the login I used, this line of code right after the connection line to recognize the encrypted pwd as Dreamweaver doesn't do it on its own

if (isset($_POST['pwd'])) { $_POST['pwd'] = sha1($_POST['pwd']);}

but surprisingly, it is not working, I am being redirect to the error page instead, even though I am using both right user and password.


Any one, has any idea how I can possibly solve this problem.

Romeo

This topic has been closed for replies.

2 replies

David_Powers
Inspiring
September 22, 2009

Marking as assumed answered

David_Powers
Inspiring
September 21, 2009

How big is the pwd column in your database? Anything encrypted with sha1 needs to be VARCHAR(40). If it's less than 40, it won't match.

September 22, 2009

thank you Mr. Power, that was the only problem, it works perfectly now, so thank you a lot. And for the record, your book has been a veritable bible for my learning, I am happy I put my hands on it.

Romeo

Date: Mon, 21 Sep 2009 16:53:27 -0600

From: forums@adobe.com

To: romeofilms@hotmail.com

Subject: Password, Dreamweaver, PHP and mysql

How big is the pwd column in your database? Anything encrypted with sha1 needs to be VARCHAR(40). If it's less than 40, it won't match.

>