Sourav Sourav - 1 year ago 186
PHP Question

Invite friends to an application - Facebook

Previously my this code worked well but now it do nothing

I want to show an dialog then the user will be able to select some friends and invite them to use this application.

Now this code shows blank page.

include_once "fbmain.php";
if (isset($_REQUEST['ids'])){
echo "Invitation Sent";
$string = "<script type='text/javascript'>top.location.href='{$fbconfig['appBaseUrl']}';</script>";
echo $string;
else {
<fb:serverFbml style="width: 500px;">
<script type="text/fbml">
type= <?php echo $fbconfig['appname']; ?>
content="I tried this and love this, what about you ? <fb:req-choice url='<?php echo $fbconfig['appBaseUrl']; ?>' label='Accept' />"

actiontext=<?php echo $fbconfig['appname' ]; ?>>

Answer Source

Now to invite friends the only way is to use FB JS the code

function showInvite()
if (strlen($fbconfig['appname' ])>50)
 $title = substr($fbconfig['appname' ],0,45);
 $title = $title . ' ...';
 $title = $fbconfig['appname' ];

if (strlen($fbconfig['appBaseUrl'])>200)
 $message = substr($fbconfig['appBaseUrl'],0,200);
 $message = 'I just love this App, now it\'s your turn to try it @ '.$message;
 $message ='I just love this App, now it"s your turn to try it @ '.$fbconfig['appBaseUrl'];
 var r = FB.ui({ 
            method : 'apprequests',
            message: '<?php echo $message; ?>',
            title: '<?php echo $title; ?>',
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download