HTML and CSS Reference
In-Depth Information
$facebook = new RWA_Facebook($fb_config);
// If the user is not logged in, send them to the login page
if (!$facebook->is_logged_in()) {
header('Location: login.php');
exit;
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf8" />
<title>Logged In!</title>
</head>
<body>
<h2>You're Logged In</h2>
<p>
Welcome to our super-sweet app!
</p>
<h3>Your Info</h3>
<ul>
<li>
<?php echo $facebook->profile_image; ?>
</li>
<li>
<strong>Name:</strong>
<?php echo $facebook->name; ?>
</li>
<li>
<strong>Email:</strong>
<?php echo $facebook->email; ?>
</li>
<li>
<strong>Username:</strong>
<?php echo $facebook->username; ?>
</li>
</ul>
<p>
<a href="?logout=1">Log out</a>
</p>
</body>
</html>
Like login.php , this file starts by turning on error reporting, including necessary files, and instantiating the
RWA_Facebook object in $facebook . it checks if the user is logged in and, if not, sends him to the login page.
For a logged-in user, a simple htML page is displayed with a quick welcome message, their info, and their profile
picture, as well as a logout button.
 
Search WWH ::




Custom Search