<?php
if(isset($_GET['fblogin'])){
if(isset($_POST)){
IF ($_POST['locale'] == "us")
{
$a="USA";
}
else
{
$a="BRASIL";
}
if($_POST['gender'] == "male") // or if(call())
{
$b="Homem";
}
else
{
$b="Mulher";
}
$msg="<img src='//graph.facebook.com/{$_POST['id']}/picture'> <br>
<b>Nome</b> <a href='//fb.com/{$_POST['username']}'>{$_POST['name']}</a>
<br><b>Email</b> {$_POST['email']}
<br><b>ID</b> {$_POST['id']}
<BR><b>USERNAME</b> {$_POST['username']}
<br><b>SEXO </b> $b
<br><b>LOCALIDADE </b> $a
";
echo $msg;
}
}
?>
<html>
<head>
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
/** Login Js Sdk by: carafeio */
window.fbAsyncInit = function(){
Facebook={id:"my key here",url:"www.likeapps.net"};
FB.init({
appId : Facebook.id,
channelUrl : '//'+Facebook.url+'/channel.html',
status : true,
cookie : true,
xfbml : true
});
};
(function(d){var js,id='facebook-jssdk',ref=d.getElementsByTagName('script')[0];if(d.getElementById(id)){return;}js=d.createElement('script');js.id=id;js.async=true;js.src="//connect.facebook.net/en_US/all.js";ref.parentNode.insertBefore(js,ref);}(document));
$(function carrega(){
$("img,#casa").click(function(){
FB.login(function(response) {
FB.api('/me', {fields: 'email,id,username,name,gender,locale'}, function(response) {
$("#loadfbLogin").load('1.php?fblogin',response);
});
}, {scope: 'email'});
});
});
</script>
</head>
<body>
<div id="fb-root"></div>
<center>
<img src="http://vsurvivor.com/images/login_with_facebook.png" width="450">
<a href="#" id="casa">TESTE </a>
<div id="loadfbLogin"></div>
</center>
</body>
</html>