Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6976815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:32:43+00:00 2026-05-27T17:32:43+00:00

I have a php based website www.darooadda.com. I want to know if there is

  • 0

I have a php based website http://www.darooadda.com. I want to know if there is any facebook API to invite friends from facebook account. If a user logins the webite using facebook account, he should be able to invite his facebook friends from the website.

Can anyone help me with the correct api documentation or sample php code for the same?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:32:43+00:00Added an answer on May 27, 2026 at 5:32 pm

    this sample code can use facebook API 3.0.1, request friends and post back to your site if request sent

    $<?php
    // Requires Facebook PHP SDK 3.0.1: https://github.com/facebook/php-sdk/
    require ('includes/facebook.php');
    define('FACEBOOK_APP_ID',"your facebook ID");
    define('FACEBOOK_SECRET',"your facebook secret password");
    
    $user = null;
    
    // Create our Application instance (replace this with your appId and secret).
    $facebook = new Facebook(array(
    'appId' => FACEBOOK_APP_ID,
    'secret' => FACEBOOK_SECRET,
    'cookie' => true
    ));
    
    $user = $facebook->getUser();
    $loginUrl = $facebook->getLoginUrl();
    
    if ( empty($user) ) {
    echo("<script> top.location.href='" . $loginUrl . "'</script>");
    exit();
    }
    ?>
    <!doctype html>
    <html>
    <head>
      <title>Send An Application Request Using The Facebook Graph API</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
    
    </head>
    <body>
     <div id="fb-root"></div>
    
    
    <a href="#">Send Application Request</a>
    
    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId: '<?php echo $facebook->getAppID() ?>',
          status: true,
          cookie: true,
          oauth: true
        });
      };
    
      $('a').click(sendRequest);
      function sendRequest() {
        FB.ui({
          method: 'apprequests',
          message: 'Check out this application!',
          title: 'Send your friends an application request',
        },
        function (response) {
          if (response.request && response.to) {
            var request_ids = [];
            for(i=0; i<response.to.length; i++) {
              var temp = response.request + '_' + response.to[i];
              request_ids.push(temp);
            }
            var requests = request_ids.join(',');
            $.post('handle_requests.php',{uid: '<?php echo $user; ?>', request_ids: requests},function(resp) {
              // callback after storing the requests
            });
          } else {
            alert('canceled');
          }
        });
        return false;
      }
    
      // Load the SDK Asynchronously
      (function(d){
        var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        d.getElementsByTagName('head')[0].appendChild(js);
      }(document));
    </script> 
     </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HI I'm building a php based website and wanted to know if there any
We have a website that we want to provide web based API access to
I have a problem with maintenance of my php based website. My website is
I have been writting a keyword search script based on this tutorial: http://www.hackosis.com/2007/11/06/howto-simple-search-engine-with-php-and-mysql/ Like
I want to add one to one chat component in my PHP based website
Building a website using a PHP based Ecommerce product Magento. The problem I have
I have a website based on wordpress. I want to implement a click tracking
I have the following setup for my Django based website: <VirtualHost 10.0.0.4> DocumentRoot /home/joel/www
I have a website authored in PHP where any time a user receives an
We have a current (legacy) PHP based website that is unlikely to be redeveloped

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.