בעייה קטנה בקובץ התחברות( כנראה בקוקיז )
הקובץ מכיל את הקוד הבא
PHP קוד:
<?
include("db.php");
$submit = $_POST['submit'];
$username = $_POST['username'];
$password = $_POST['password'];
if($submit) {
$password = md5($password);
$sql = " SELECT * FROM users WHERE 1 AND username = '$username' AND password = '$password' AND activated='1' ";
$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();
}
mysql_query("UPDATE users SET last_login=now() WHERE userid='$userid'");
setcookie("username", $username,time() + 3600);
setcookie("password", $password, time() + 3600);
setcookie("id", $id, time() + 3600);
echo "<meta http-equiv='refresh' content='5; url=index.php'>";
}
?>
שגיאה:
ציטוט:
Warning: Cannot modify header information - headers already sent by (output started at /home/checked.php:1) in /home/public_html/checked.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at /home/ibain/domains/ibain.net/public_html/checked.php:1) in /home/public_html/checked.php on line 21
Warning: Cannot modify header information - headers already sent by (output started at /home/ibain/domains/ibain.net/public_html/checked.php:1) in /home/public_html/checked.php on line 22
|
הדגשתי את השורות שקיימות בהם השגיאה,
מצפה לעזרה בזמן הקרוב.
|