Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

Trouble in PHParadise

  • Please log in to reply




  • Member
  • PipPip
  • 82 posts
Hi All,

Well I'm setting up my first database with username and password access to members area.
The problem I am having is that the md5 result from the registration form password doen't match the md5'd result of the logon form password - given that I am entering the same password.

using this code for the registration form / database table insertion:-
print ('before md5 ' . $arVals['ppassword']);
$arVals['ppassword'] = "'".md5($arVals['ppassword'])."'";
print (' after md5 ' . $arVals['ppassword']);

SHows a result of:- before md5 'dddd' after md5 'b7ac20233cf6b55bde4d324323b17abb'

However, in the same page of code:-
$inputdata = ('dddd');
$result = md5($inputdata);
print (' mdfive test ' . $result);

SHows a result of:- mdfive test 11ddbaf3386aea1f2974eee984542152

This is consistent with the result of the code I have used for entering the users password.
I dont understand why they should be different or how I can get arround this.

It may be helpful to convert back from md5 to original so I can see which one is the incorrect result for 4 d's entered as a password.

  • 0





  • Topic Starter
  • Member
  • PipPip
  • 82 posts
I have managed to sort it out....

it was all about the "'" 's. The md5 included them in the array before conversion, but not on the $_post from the login page.

Thanks anyway...
  • 0



    Retired Staff

  • Retired Staff
  • 1,869 posts

It may be helpful to convert back from md5 to original

Just as a note, that is very, very hard to do.

Yes, md5 will change the result hugely if you include an extra character.
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP