HTML and CSS Reference
In-Depth Information
header("Location: ./");
<!doctype html>
<html lang="en">
<meta charset="utf8" />
<title>Please Log In</title>
<h2>Please Log In</h2>
Before you can use this sweet app, you have to log in.
<a href="<?php echo $facebook->get_login_uri(); ?>">
Log In with Facebook
this file starts by setting error reporting as high as possible to make sure the code is squeaky clean and then
includes both OAuth classes and the Facebook config file.
With the necessary files loaded, a new RWA_Facebook object is instantiated and stored in $facebook . the script
then checks if the user is logged in by running the is_logged_in() method and redirects to the home page if so.
For a logged-out user, a simple htML page is displayed asking the user to log in. A login uRi is generated using
the get_login_uri() method.
Step 6: Create the App's Home page
the last file to create is the app's home page. Create a file called index.php in web root and then add the
following code:
// 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/';
Search WWH ::

Custom Search