I\'m using the Facebook PHP SDK (2.1.2). All I want to do is what almost every Facebook application with req_perms
has. The stupid \"request for permissions\" b
Basically, you use the PHP SDK to get the login URL and then do a JavaScript redirect to that URL. The example http://github.com/facebook/php-sdk/blob/master/examples/example.php
does everything for you except for the redirect. In the example, they have a link you click to login. If you want it to be automatic, do the following.
<script>
FB.getLoginStatus(function(response) {
if (response.session) {
// Logged in and connected user, someone you know.
}
else {
// No user session available, redirect them to login.
window.top.location = <?php echo $loginUrl; ?>
}
});
</script>