Helpful Information
Category: Facebook Connect
Facebook Connect -> Call back (close po-up) -> FB user info check -> setter query

I am trying to write a program:

1) There is a Facebook Login button in index.php
When you click on it, the facebook connect will be appear with popup window
2) When you back callback url the pop-up window will be closed.
3) Graph API will retrieve user info ( (email,user name, profile picture url,gender ), When these data come with jquery, all info will be send to server. Then we retrieve all these data to index2.php page. ( We will do these by JSON )

Shortly: Facebook Connect -> Call back (close po-up) -> FB user info check -> setter query -> getter query -> display data

I have index.php and able to get fb connect and get user data by Graph API. But I do not know how to pass data to server and retrive them to index2.php

Here is my index.php:


//uses the PHP SDK. Download from
//require 'facebook-platform/php/facebook.php';
require 'facebook-php-sdk/src/facebook.php';

$facebook = new Facebook(array(
'appId' => '289329761120769',
'secret' => '9cad1979d8379605dc04e3c48bf7c18c'

$userId = $facebook->getUser();


<html xmlns="" xmlns:fb="">
<?php if ($userId) {
$userInfo = $facebook->api('/' + $userId); ?>
Welcome <?= $userInfo['name'] ?> </br>

gender <?= $userInfo['gender'] ?> </br>

username <?= $userInfo['username'] ?> </br>

email <?= $userInfo['email'] ?> </br>

website <?= $userInfo['website'] ?> </br>

<img src="<?= $userInfo['id'] ?>/picture"/> </br>

<?php } else { ?>
<div id="fb-root"></div>

<div class="fb-login-button" scope="email,user_website">
Login with Facebook
<!--fb:login-button" data-scope="email,user_website"></fb:login-button-->

<?php } ?>
window.fbAsyncInit = function() {
appId : '289329761120769',
status : true,
cookie : true,
xfbml : true,
oauth : true

FB.Event.subscribe('auth.login', function(response) {

var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); = id; js.async = true;
js.src = "//";