PHP Header Errors?
Posted: Thu Jun 03, 2010 6:15 am
So recently I was developing a Facebook Application that embeds a SWF Flash game, after countless discussions on the Facebook dev forums I'm told the facebook code is fine it is just a problem with the PHP somewhere. It was suggested I try the ob_start() function but I'm not familiar it at all, but I tried to apply it based on what I could read up on it but I couldn't get it. Here are my errors, the sections of the code that produce them and the applications I applied. Anyone got any ideas on what the issue may be?
So I attempt to wrap the PHP on line 8 with the ob_start() like so:
So then I tried wrapping the PHP code starting at line 397 on facebook.php in the ob_start() like so:
Neither of these suppressed the header code. I also tried to standardize the game code to make the game appear but no changes took place even once it read like so:
So still a little unsure - don't think I made any progress in these attempts
Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at /home/content/88/5410988/html/hhlinks/cb/index.php:8) in /home/content/88/5410988/html/hhlinks/cb/facebook.php on line 397
Warning: Cannot modify header information - headers already sent by (output started at /home/content/88/5410988/html/hhlinks/cb/index.php:8) in /home/content/88/5410988/html/hhlinks/cb/facebook.php on line 397
Warning: Cannot modify header information - headers already sent by (output started at /home/content/88/5410988/html/hhlinks/cb/index.php:8) in /home/content/88/5410988/html/hhlinks/cb/facebook.php on line 397
Warning: Cannot modify header information - headers already sent by (output started at /home/content/88/5410988/html/hhlinks/cb/index.php:8) in /home/content/88/5410988/html/hhlinks/cb/facebook.php on line 401Code: Select all
<?php
ob_start();
require_once 'facebook.php';
$appapikey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXX';
$appsecret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
ob_end_flush();
?>Code: Select all
ob_start();
foreach ($cookies as $name => $val) {
setcookie($this->api_key . '_' . $name, $val, (int)$expires, '', $this->base_domain);
$_COOKIE[$this->api_key . '_' . $name] = $val;
}
$sig = self::generate_sig($cookies, $this->secret);
setcookie($this->api_key, $sig, (int)$expires, '', $this->base_domain);
$_COOKIE[$this->api_key] = $sig;
ob_end_flush();Code: Select all
<fb:swf swfsrc="http://www.hhlinks.net/CB2.swf" swfbgcolor="#000000" wmode = "opaque" width="500" height="500" imgsrc="http://www.hhlinks.net/cb/logo.jpg" width='600' height='570' />