I have a sign up page for making the registration. Here is some code inside:
else if($key == "password")
{
$pwd=md5($val);
}
else if($key == "password")
{
$pwd2=md5($val);
}
After checking passwords are the same in two fields, I store the user name and its password to a table in mysql, and I can see it's added in. For example, after one user is registered, the password value is f1c1592588411002af34.
In my login page, when I want to check user name and password, it's not working properly. Again I use md5() to convert the password: $passw = md5($_POST['pwd']); but it seems not given the same value. I did print checking: echo "> $passw <";
Then, the page displays '> f1c1592588411002af340cbaedd6fc33 Login'
The first 20 charactors are the same, but hashed values are much longer in my login page. I don't know where did that 'Login' string come from. Moreover, the charactor '<' did not get displayed.
Could someone explain why it is like this? Did I use md5() or something else wrong?
Thanks.