אתה צריך לשים את הob_start לפני הכל
PHP קוד:
<? ob_start(); ?>
<center><font face=arial size=3>
<?
include "includes/config.php";
include "includes/includes/db.php";
$submit = $_POST['submit'];
$username = $_POST['username'];
$password = $_POST['password'];
if($submit) {
$sql = "
SELECT *
FROM members WHERE 1
AND username = '$username'
AND password = '$password'
";
$result = mysql_query($sql) or die("בעייה : " . mysql_error());
while ($row = mysql_fetch_array($result)) {
$username = $row["username"];
$password = $row["password"];
$id = $row["id"];
}
if(!mysql_num_rows($result)) {
echo "שם משתמש או סיסמה שגויים";
exit();
}
setcookie("user", $username,time() + 3600);
setcookie("pw", $password, time() + 3600);
setcookie("id", $id, time() + 3600);
echo "<meta http-equiv='refresh' content='5; url=index.php'>";
}
?> </center></font>
<? ob_end_flsuh(); ?>