HTML and CSS Reference
In-Depth Information
Step 4: Create a Facebook Config File
the RWA_Facebook class will be loaded on both the app's home page and the app's auth endpoint, so the
Facebook configuration details will be abstracted to a separate file. in the includes folder, create a new file
named and put the following inside:
$fb_config = array(
'client_id' => '404595786243388',
'client_secret' => 'da2c599d9662ee744700dbfa483a154e',
=> ' ',
'scope' => 'email',
this file is extremely simple: it defines an array, stored in $fb_config , that will be passed to the constructor of
the RWA_Facebook class when it is instantiated.
Make sure to replace client_id and client_secret with your app's credentials, because they are
domain-specific and will not work on domains for which they are not set up.
Step 5: Create the App's Auth endpoint
now that all the classes and config files are in place, you can start building the actual pages for the app. Start by
creating the file login.php in web root. inside, place the following:
// Set error reporting to keep the code clean
ini_set('display_errors', 1);
// Loads the Facebook class
require_once 'includes/';
require_once 'includes/';
// Loads the $fb_config array
require_once 'includes/';
$facebook = new RWA_Facebook($fb_config);
// If the user is logged in, send them to the home page
if ($facebook->is_logged_in()) {
Search WWH ::

Custom Search