הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 20-07-08, 18:38   # 1
kfir91
חסום
 
מיני פרופיל
תאריך הצטרפות: Apr 2007
הודעות: 220

kfir91 לא מחובר  

שגיאה עם קוקיס ו headers

זה השגיאה :
קוד:
Warning: Cannot modify header information - headers already sent by (output started
זה הקוד :
קוד:
<html dir="rtl">
<head>
	<title>דף ראשי</title>
	<? include "config.php"; ?>
</head>
<body>

<?
$hour = time() + 3600;
$username = $_COOKIE['user'];
$password = $_COOKIE['pass'];

if(!isset($_COOKIE['user']))
    {
    echo "אתה אינך מחובר :: <a href=\"?act=loginform\">התחברות</a><br />";
    }
else
    echo "ברוך הבא $username :: <a href=\"?act=logout\">התנתק</a><br />";

$act = $_GET['act']; // הגדרת משתנה ראשי

if ($act == "logincheck") // בדיקת התחברות
{
// הכנסת פרטי הטופס למשתנים
$user = $_POST['User'];
$pass = $_POST['Pass'];

// בדיקת טופס

echo "
	<table class=\"loginchecktable\">
	<tr><td valign=\"top\" dir=\"rtl\" class=\"login_check_td_table\">";

	if ($pass == "")
	{
	   echo "סיסמא לא הוזנה";
	   echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=?act=loginform\">";
	}
	else if ($user == "")
	{
	   echo "שם משתמש לא הוזן";
	   echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=?act=loginform\">";
	}
	else
	{
	$s = mysql_query("SELECT * FROM members WHERE username='$user' && password='$pass'") or die(mysql_error());
	$checkform = mysql_num_rows($s);

		if ($checkform == "0")
		{
		echo "אחד מהפרטים אינו נכון";
		echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=?act=loginform\">";
		}
		else
		{
		   echo "התחברת בהצלחה";
		   setcookie(user, $user, $hour);
		   setcookie(pass, $pass, $hour);
		   echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=index.php\">";
		}
	}

echo "</td></tr>";
echo "</table>";
}

else if ($act =="loginform") // טופס התחברות
{
if(!isset($_COOKIE['user']))
{
echo <<<LOGINFORM

<form action="?act=logincheck" method="post"> 
<table class="logintable">

	<tr><td valign="top" dir="rtl" class="logintdtable">שם משתמש: </td>
	<td valign="top" dir="rtl" class="logintdtable"><input type="text" name="User"></td>
	</tr>
	<tr><td valign="top" dir="rtl" class="logintdtable">סיסמא:  </td>
	<td valign="top" dir="rtl" class="logintdtable"><input type="password" name="Pass"></td>
	</tr>
	<tr><td valign="top" dir="rtl" class="logintdtable"></td>
	<td valign="top" dir="rtl" class="logintdtable"><input type="reset" value="נקה"><input type="submit" value="התחבר"></td>
	</tr>
</table>
</form>  

LOGINFORM;
}
else
   {
   echo "אתה מחובר למערכת";
   echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=index.php\">";
   }
}

else if($act == "logout")
{
   $past = time() - 100;
   setcookie(user, gone, $past); 
   setcookie(pass, gone, $past); 
   echo "התנתקת בהצלחה";
   echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=index.php\">";
}

?>

</body>
</html>
הבעיה היא בשורות :
קוד:
		   setcookie(user, $user, $hour);
		   setcookie(pass, $pass, $hour);
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 11:30.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ