ecco tutto il codice, il problema è che prima su questo db andavano password senza md5 ora ho impostato md5 ma non riesco ad effettuare il login
Codice PHP:
<? $need_to_login=no; $title=Login; include("config.php");
$check = mysql_num_rows(mysql_query("select * from j5itusers_entity where username='$user' AND password = '.md5($pass).'"));
if ($check >= 1) {
setcookie("username", "$user");
setcookie("password", "$pass");
}
if ($check <= 0) {
print "Incorrect username/password combination.";
}
else {
$stat = mysql_fetch_array(mysql_query("select * from j5itusers_entity where username='$user' and password = '.md5($pass).'"));
$date = date("d m Y");
$ip = $REMOTE_ADDR;
mysql_query("UPDATE j5itusers_entity SET logins=logins+1 WHERE guid = $stat[guid]");
mysql_query("UPDATE j5itusers_entity SET days_inactive=0 WHERE guid = $stat[guid]");
mysql_query("insert into login_log (ip, account, date) values('$ip','$user','$date')")or die("Could not add to log.");
header ("Location: stats.php");
print "
<center>
Login Successful! Redirecting...
</center>
<META HTTP-EQUIV='Refresh'
CONTENT='1; URL=stats.php?ref=login'>
";
}
include("footer.php"); ?>
grazie