motormichael12
06-03-2007, 12:50 AM
ok so ive got the following code and it wont work... it is for facebook, but i still cant find the error. order is the code, then the error.
<?php
require_once("facebook.php");
$appapikey = '<hidden>';
$appsecret = '<hidden>';
$facebook = new Facebook($appapikey, $appsecret);
$user = $facebook->require_login();
//[todo: change the following url to your callback url]
$appcallbackurl = 'http://michael.hungerford.us/fb.prayer.list/';
//catch the exception that gets thrown if the cookie has an invalid session_key in it
try {
if (!$facebook->api_client->users_isAppAdded()) {
$facebook->redirect($facebook->get_add_url());
}
} catch (Exception $ex) {
//this will clear cookies for your application and redirect them to a login prompt
$facebook->set_user(null, null);
$facebook->redirect($appcallbackurl);
}
?>
and it returns the error:
Parse error: parse error, unexpected '{' in /homepages/37/d91075885/htdocs/hungerford/michael/fb.prayer.list/appinclude.php on line 13
i cant figure out why i get this error. if it had somehting to do with the required file, it would say an earlier line... so can u help me?
<?php
require_once("facebook.php");
$appapikey = '<hidden>';
$appsecret = '<hidden>';
$facebook = new Facebook($appapikey, $appsecret);
$user = $facebook->require_login();
//[todo: change the following url to your callback url]
$appcallbackurl = 'http://michael.hungerford.us/fb.prayer.list/';
//catch the exception that gets thrown if the cookie has an invalid session_key in it
try {
if (!$facebook->api_client->users_isAppAdded()) {
$facebook->redirect($facebook->get_add_url());
}
} catch (Exception $ex) {
//this will clear cookies for your application and redirect them to a login prompt
$facebook->set_user(null, null);
$facebook->redirect($appcallbackurl);
}
?>
and it returns the error:
Parse error: parse error, unexpected '{' in /homepages/37/d91075885/htdocs/hungerford/michael/fb.prayer.list/appinclude.php on line 13
i cant figure out why i get this error. if it had somehting to do with the required file, it would say an earlier line... so can u help me?