ok,
I created a login code, works fine....
But, when i input the correct password it doesnt work. I have tried this without the database password being md5 and the input password.. they come out identical and it works fine.
When i md5 the password in sql and in the input on the form, the numbers and letters come out identical (because i echoed them just to check) but the input password comes out with extra letters and numbers:
Here they are:
gmforum
pass: df5864d4daadad6840b5
inputuser: gmforum
inputpass: df5864d4daadad6840b52a2dcfb08990
The password is meant to be: gmforum (this is a test login script, nothing special).
I tried them as i said before without the md5 encryption and it showed:
gmforum
pass: gmforum
inputuser: gmforum
inputpass: gmforum
And there was no error message just said "Welcome", but when md5 it would say "incorrect password".
I md5 my password like this to compare with the database:
$user = $loginvars['user'];
$pass = md5($loginvars['pass']);
-
- $user = $loginvars['user'];
-
- $pass = md5($loginvars['pass']);
-
-
then i compare like this:
if ( $sqluser == $user && $sqlpass == $pass ) {
$uerror = Welcome;
-
- if ( $sqluser == $user && $sqlpass == $pass ) {
-
- $uerror = Welcome;
-
-
im really confused, why is this happening?1