PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$db = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname,$db) or die (mysql_error);
$Q01 = "SELECT Password
FROM $dbtable
WHERE UserName='$UserName'";
$R01 = mysql_query($Q01) or die("Bad Q01:".mysql_error());
$info = mysql_fetch_array($R01);
if(md5($Password) != $info[Password])
{
echo( "Your Password is Incorect");
ViewHeader($SmartID);
//header("Location: home.php");
ViewFooter();
exit;
}
?>
For some reason when i submit my password it encrypts it again but the encryption is dofferent from the one in the data base! Any ideas why this is happeneing??
how is $password differ from $info['password']? if it's just the stored password lacks some characters from the original password, then maybe the encrypted password exceeds the maximum number of characters your password field allows. check it...
and of course, make sure your field type is able to store string formats (e.g. varchar)