Jump to content

Warning: Cannot modify header information


eaglelegend

Recommended Posts

I am getting this on one of my pages:

Warning: Cannot modify header information - headers already sent by (output started at /misc/39/000/171/334/2/user/web/eaglelegend.com/header.php:5) in /misc/39/000/171/334/2/user/web/eaglelegend.com/members.php on line 3

 

This is members.php:

<?php
if($_COOKIE['elv2']=="") {
	Header("Location: http://www.eaglelegend.com/index.php?message=You are logged out! Please log back in!");
}

$creditsSQL = mysql_query("SELECT * FROM `members` WHERE `username`='{$_COOKIE['ELv2']}'");
while($creditsROW = mysql_fetch_array($creditsSQL)) {
	$MONEY = $creditsROW["money"];
	$POINTS = $creditsROW["points"];
	$FROZEN = $creditsROW["frozen"];
}

if($FROZEN==1) {
	print "<b>YOUR ACCOUNT IS FROZEN! PLEASE CONTACT THE SITE ADMIN. YOU HAVE BEEN LOGGED OUT!</b>";

setcookie("ELv2",null);
}
?>

Link to comment
Share on other sites

Maybe it's the spaces in your url. You also need and exit() statement after the header() call. I also changed your check for an empty string to use empty().

 

<?php
if (empty($_COOKIE['elv2']))
{
$url = rawurlencode("message=You are logged out! Please log back in!");
header("Location: http://www.eaglelegend.com/index.php?$url");
exit();
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.