Hi friends,
I'm writing a login.php script.
I stored the password in mysql db as encrypted format using md5.
(It's in registration.ph p and it works well).
There is a no problem in registering new users.
When the login form exists, the password and confirm password didn't match always. It shows only "Password didn't match, plz try again".
Can anyone help me.....??? The code which wrongly works is as follows:
while($info = mysql_fetch_arr ay( $check ))
{
$_POST['pass'] = stripslashes($_ POST['pass']);
$info['password'] = stripslashes($i nfo['password']);
$_POST['pass'] = md5($_POST['pass']);
if ($_POST['pass'] != $info['password'])
{
die('Incorrect password, please try again.');
}
else
{
$_POST['username'] = stripslashes($_ POST['username']);
$hour = time() + 3600;
setcookie(ID_my _site, $_POST['username'], $hour);
setcookie(Key_m y_site, $_POST['pass'], $hour);
header("Locatio n: members.php");
}
}
Plz... Tell me the correct code soon...
I'm writing a login.php script.
I stored the password in mysql db as encrypted format using md5.
(It's in registration.ph p and it works well).
There is a no problem in registering new users.
When the login form exists, the password and confirm password didn't match always. It shows only "Password didn't match, plz try again".
Can anyone help me.....??? The code which wrongly works is as follows:
while($info = mysql_fetch_arr ay( $check ))
{
$_POST['pass'] = stripslashes($_ POST['pass']);
$info['password'] = stripslashes($i nfo['password']);
$_POST['pass'] = md5($_POST['pass']);
if ($_POST['pass'] != $info['password'])
{
die('Incorrect password, please try again.');
}
else
{
$_POST['username'] = stripslashes($_ POST['username']);
$hour = time() + 3600;
setcookie(ID_my _site, $_POST['username'], $hour);
setcookie(Key_m y_site, $_POST['pass'], $hour);
header("Locatio n: members.php");
}
}
Plz... Tell me the correct code soon...
Comment