View Single Post
Old 12-16-07, 01:23 PM   #3
sytaylor
Cerebral Barbarian
 
sytaylor's Avatar
 
Join Date: Nov 2000
Location: Leeds, UK
Posts: 1,656
Default Re: Facebook App development

Sure

Code:
<?php
require_once 'appinclude.php';

echo '<p>hello $user</p>';
That basically just calls appinclude which does the linking to the facebook platform.

Code:
<?php
require_once 'facebook.php';

$appapikey = 'f501a8b28b9766cb836d90fe8bae708f';
$appsecret = '8b5e7680397dd4973c5d1d6991339a80';
$facebook = new Facebook($appapikey, $appsecret);
$user = $facebook->require_login();

//[todo: change the following url to your callback url]
$appcallbackurl = 'http://www.themajesticself.com/facebooksytest/';

//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);
}
When facebook.php is included in a download pack from facebook itself, to be installed on the webserver. Any ideas where my error is?
__________________
Intel Core 2 Quad Pro Q6600 @ 3.42GHz | Abit IP35 Pro | GeIL 4GB DDR2
Gainward BLISS GeForce 8800 GTS 512MB 770/1920/1070
Creative Audigy 2ZS on Logitech Z-680s
Yuraku 24" Widescreen monitor

It saddens me that I need the following to post here:

Disclaimer: Any views expressed in the above post under the psuedonym "sytaylor" are entirely subjective and do not reflect the views of any business, company or entity associated with Simon Taylor. The use, copying of or editing of any materials within this post for professional purposes without written permission is stricly prohibitted under the UK Right of Privacy as provided in the Human Rights Act 1998 and the European Convention on Human Rights: Article 10 ECHR. Any attempt to use the information herin shall be subject to the Data Protection Act and Freedom of Information act, with damages being saught for defamation. This disclaimer applies to all text, images or media on this domain.

You have been warned.
My Blog
sytaylor is offline   Reply With Quote