简体   繁体   中英

A “1” output with Facebook php-sdk

I can't figure it out and it's hard to Google:

My iframe produces a "1" just before the

but I can't figure out why and where it comes from. http://www.quepasa.in-town.nl/facebook/

My code:

require 'fb-sdk/src/facebook.php';
$facebook = new Facebook(array(
'appId' => 'xxxxxxx',
'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
));

$signed_request = $facebook->getSignedRequest();

$page_id = $signed_request["page"]["id"];
$page_admin = $signed_request["page"]["admin"];
$like_status = $signed_request["page"]["liked"];
$country = $signed_request["user"]["country"];
$locale = $signed_request["user"]["locale"];

if ($like_status) {
echo include("page-revealed.php");} else {echo include("page-signup.php");}

The revealed and signup have not more then this and temporary deleting everything didn't help.

Does anyone know where this is coming from?

This is because you are doing an "echo" on an include. Remove the echo and just have it as

if ($like_status) {
include("page-revealed.php");} else { include("page-signup.php");}

And you should be good.

you don't need to echo include, just include basically

Just do:

include("http://www.mysite.net/script.php");

Or:

echo file_get_contents("http://www.mysite.net/script.php");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM