Thread: md5 question
View Single Post

  #2 (permalink)  
Old 08-12-2003
Louis-Philippe Huberdeau
 
Posts: n/a
Default Re: md5 question

The md5 algorithm generates a 32 characters hash. Make sure your
database field can contain those 32 characters, otherwise, it will be
truncated.

entoone wrote:
> I am having problems with using md5 with a password.
>
> I am able to set the password with the md5 coverting what I type into say..
> "a87ff679a2f3e71"
>
> I'm writing to the db with the password and the condition by using
>
> -------- pword=md5('$ud_pword')
>
> I am having a problem reading the value from the db after it's set. I use a
> form that wants an id and the password to load the record for editing, when
> I type "a87ff679a2f3e71" into the form It loads, when I type the password
> that I typed in the form that made coverted to "a87ff679a2f3e71" it
> doesn't work.
>
> So the password is entered, saved in the db as "a87ff679a2f3e71"
>
> and now I want to relogin with the standard password, without having to type
> "a87ff679a2f3e71"
>
>
> I'm attempting to read the password in my query as follows.
>
> $query="SELECT * FROM contacts WHERE (notid=$serid) and
> pword=md5('$serpass')";
>
>
> *** I altered this query so much, that I'm not sure what I have tired and
> not tried, as always I appreciate your efforts and assistance on my many
> questions.
>
> Thanks! in advance,
>
>
>
>


Reply With Quote