Possible Duplicate:
PHP error: Cannot modify header information – headers already sent
Hi I am getting this error even thou I am using exactly the same file for other projects and it’s working fine. This project is set after implementation by FB new API and all the changes after the end of September does this fact could be an issue?
MY FILE:
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; ?>
<users xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Thu, 1 Jan 1970 00:00:00 GMT");
include_once 'config.php';
$con = mysql_connect($db_ip,$db_user,$db_pass);
.
.
.
.
while ($row = mysql_fetch_assoc($result)) {
?>
<id>
<image>http://mywebsite/root/xxx-game-fb/proxy.php?url=<?php echo urlencode("http://graph.facebook.com/".$row['fbid']."/picture?type=square"); ?></image>
<place><?php echo $position; ?></place>
<name><?php echo $row['name']; ?></name>
<score><?php echo $row['score']; ?></score>
</id>
<?php
$position++;
}
?>
</users>
I use this as an input to flash AS3 game. It creates a table with users and sets them in order. Flash throws an error as well in the function that pulls this xml file.
Does any one knows what could be a problem here?
Please help.
Didn’t read the docs about
headerand no information can be output before a call to that method, huh?Either use header first, or use some form of output buffering if it can’t be avoided.
Your first 5 lines of your file should become:
Note that
header()is now called before anything is echo’d/output.