Collect email and send via post to php (Facebook canvas)

2

I am making an app that is well in the beginning, I ralei enough before asking for help here ... I need to get the email from the guy and send to php as POST ...

Here is the code:

 window.fbAsyncInit = function() {
   FB.init({
      appId      : 'XXXXXXXXX',
      xfbml      : true,
      version    : 'v2.4'
    });
// Código

function onLogin(response) {
    if (response.status == 'connected') {
       FB.api('/me?fields=first_name', function(data) {
       var welcomeBlock = document.getElementById('fb-welcome');
       welcomeBlock.innerHTML = 'Hello, ' + data.first_name + '!';
});
 }
}


FB.getLoginStatus(function(response) {
  // Check login status on load, and if the user is
  // already logged in, go directly to the welcome message.
  if (response.status == 'connected') {
    onLogin(response);
  } else {
    // Otherwise, show Login dialog first.
    FB.login(function(response) {
     onLogin(response);
    }, {scope: 'email'});
  }
});



//Fim código
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));


</head>
<body>

<div class="container fundo">
    <div class="row">
        <div class="col-md-6">
            <img src="img/shopitoslogo.png" width="90%">
             <div class="row cadastro">
                 <div class="col-md-4 link "> <button class="btn btn-success">Instalar</button></div>
            </div>        
        </div>
        <div class="col-md-3 lado-direito">

        </div>
    </div>
    <div class="row">
        <div class="col-md-12"> <p>Que tal instalar nosso App em sua <br> Fan Page?</p></div>
</div>       
<div class="fb-like"
  data-share="true"
  data-width="450"
  data-show-faces="true">
</div>
    </div>


</div>


</body>
</html>
    
asked by anonymous 11.08.2015 / 16:36

0 answers