• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[PHP] Facebook API

(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
So lately I have been into making an app for facebook.

I was wondering if anyone could help me make a page that does following:

  • If user is new to app, ask for full permission to access info online/offline, send wall posts
  • If user has already added application just show his name or something.
I have tried using login button, but I would like to see like a permission thing popup right away.
 
(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
Yes but I want to redirect user to "Request for Permission" page directly without having him to click on the login button as shown in example.
 
Junior Spellweaver
Joined
Oct 31, 2010
Messages
130
Reaction score
6
You could directly call the script instead of having the user to click on login first.. should be simple with a few modifications, let me know!
 
(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
Tried following but redirects to facebook page:
PHP:
<?php
include_once "facebook.php";
 
$facebook = new Facebook(array('appId'=>'xxxxxxxxxxxxxxxxxxxxx','secret'=>'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx','cookie'=>true,'domain'=>'jm2.me'));
 
$session = $facebook->getSession();

if ($session)
{
	echo 'In!';
}
else
{
	$url = $facebook->getLoginUrl( array( 'canvas'=>1, 'fbconnect' => 0 ) );
	header( 'Location: '.$url );
}
 
?>
 
Junior Spellweaver
Joined
Oct 31, 2010
Messages
130
Reaction score
6
Does it automatically check if the user is logged into facebook?
 
(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
It doesnt check if user is logged into facebook. But it checks if application has permission to access user profile, etc

---------- Post added at 12:58 PM ---------- Previous post was at 11:33 AM ----------

Ohh wait ya it does. My bad
 
Back
Top