Se non sbaglio mi sembrava che hashassi le password con l'MD5. Se è cosi allora l'errore è li...nel paragonarle devi hashare anche la password inserita dall'utente:
Codice PHP:
<?
$username = htmlentities(strip_tags($_POST ["username"]));
$password = htmlentities(strip_tags($_POST["password"]));
include("config.php");
mysql_connect($db_host,$db_user,$db_password,$db_name) or die ("errore nella connessione");
mysql_select_db("$db_name") or die ("errore nella selezione del database");
$sql = mysql_query("SELECT username, password FROM utenti");
$array = mysql_fetch_array($sql);
if ($_POST['username'] == $array['username'] && md5($_POST['password']) == $array['password'])
{
session_start();
$_SESSION['login'] = "ok";
echo "login avvenuto con successo";
}
else
{
header("Location: login.php");
}
?>
Cosi dovrebbe andare.