views:

29

answers:

0

When im logged in and i click on invite friends on facebook from my website, it shows a page to enter password, if i do , it takes me to my facebook home page.

If am not logged in, it shows a blank page.

Please what couldd be the possible problem(s)

My facebook invite page:

$api_key = 'xxx';
$secret  = 'xxx';


$app_name = "Skoola-Invite";
$app_url = "app-url"; 
$invite_href = "invite.php"; 

require_once 'facebook.php';

$facebook = new Facebook($api_key, $secret);
//$facebook->require_frame();
$user = $facebook->require_login();

if(isset($_POST["ids"])) {
 echo "<center>Thank you for inviting ".sizeof($_POST["ids"])." of your friends on <b><a href=\"http://apps.facebook.com/".$app_url."/\"&gt;".$app_name."&lt;/a&gt;&lt;/b&gt;.&lt;br&gt;&lt;br&gt;\n";
 </center>";
} else {
 /
 $fql = 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user.') AND is_app_user = 1';
 $_friends = $facebook->api_client->fql_query($fql);


 $friends = array();
 if (is_array($_friends) && count($_friends)) {
  foreach ($_friends as $friend) {
   $friends[] = $friend['uid'];
  }
 }


 $friends = implode(',', $friends);


 $content =
  "<fb:name uid=\"".$user."\" firstnameonly=\"true\" shownetwork=\"false\"/> has started using <a href=\"http://apps.facebook.com/".$app_url."/\"&gt;".$app_name."&lt;/a&gt; and thought it's so cool even you should try it out!\n".
  "<fb:req-choice url=\"".$facebook->get_add_url()."\" label=\"Put ".$app_name." on your profile\"/>";

?>
<fb:request-form
 action="<? echo $invite_href; ?>"
 method="post"
 type="<? echo $app_name; ?>"
 content="<? echo htmlentities($content,ENT_COMPAT,'UTF-8'); ?>">

 <fb:multi-friend-selector
  actiontext="Here are your friends who don't have <? echo $app_name; ?> yet. Invite whoever you want -it's free!"
  exclude_ids="<? echo $friends; ?>" />
</fb:request-form>
<?PHP

I dunno if my problem is from here or from my application settings on facebook?

related questions