I just started with facebook app development.
Problem is that require statement is not working.Even i tried 2 different simple php scripts with include & require statements,It is not locally on wamp server correctly but not as facebook app.
What should i do to get this done??
Code:
<?php
require 'facebook-php-sdk/src/facebook.php';
$facebook = new Facebook(array(
'appId' => 'YOUR_APP_ID',
'secret' => 'YOUR_APP_SECRET',
));
// Get User ID
$user = $facebook->getUser();
echo "your id id".$user;
?>
It is only printing your id is.Even facebook.php and other files are at right place.
requirethrows an error if the file can not be found/accessed. If you don’t see anything like that, first make sure you’ve set uperror_reportinganddisplay_errorsin your PHP development environment right. If still no messages appear, than there is no real problem with embedding the SDK; more likely getUser just returnsnullorfalse, and so you just don’t see anything when echo-ing it. Please usevar_dumpin cases like this, it’ll tell you exactly what type and value a variable really has.These are absolute basics of PHP debugging – please get a little more used to this, maybe work through some tutorials on the matter, before continuing developing PHP apps for Facebook.