Home arrow PHP arrow Page 5 - Facebook PHP API Applications: Basic Introduction

Getting an Application ID for Your Facebook API Applications - PHP

If you are a PHP developer interested in learning the PHP API applications of Facebook, then this tutorial can help you get started. Keep reading and you'll soon know not only how to add Facebook features to your website, but how to develop your own Facebook applications.

TABLE OF CONTENTS:
  1. Facebook PHP API Applications: Basic Introduction
  2. The Facebook Like Button PHP Integration into Your Website
  3. Final Working PHP Source Code for the Facebook Like Button
  4. The Recommendations Widget Facebook Plugin
  5. Getting an Application ID for Your Facebook API Applications
By: Codex-M
Rating: starstarstarstarstar / 12
August 11, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

The two plug-ins and features discussed already do not require an API for you to implement them in your website. However, some applications will require it -- for example, if you need to allow users to log in to your website using their Facebook account.

Step 1. Go to this URL: http://developers.facebook.com/setup/. It requires you to log in using your Facebook account.

Step 2. If you are logged in, Facebook Developer asks you for two things, your site's name and your site's URL. 

Under Site Name, type your application name bound with your domain name. For example, if your domain name is php-developer.org, then it will be PHP Developer Apps.

Under Site URL, enter the full URL of your domain's home page, for example: http://www.php-developer.org/

Step 3. Click "Create Application."

Facebook will then provide the complete details for you to start your Facebook API Application, particularly the Application ID, Secret key, Application URL, and so forth. For backup, you can copy and paste this information in a text editor and save it safely to your hard drive.

API Implementation Flow Chart

To make the Facebook PHP API easy for you to understand, look at the flow chart below:

Say, for example, that you need to integrate Facebook into your website by allowing users to log in, and then your PHP application will grab user-related information from Facebook and display it on your website (or use it in your other applications).

It starts by checking to see if the user has been logged in. If the user is not logged in, a Facebook login button will be presented. Once the user has logged in, your PHP application will retrieve user-related information from Facebook.

In this process, Facebook will authenticate your PHP application using the Application ID and secret key (in addition to the Facebook Application URL you  provided during registration).

Once authenticated, you can use file_get_contents PHP function to retrieve user information, so that your PHP web application can use that data on your own website.

In the second part of this tutorial, you will learn how to create an actual PHP web application implementing the above flow chart.



 
 
>>> More PHP Articles          >>> More By Codex-M
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: