| Server IP : 104.21.37.246 / Your IP : 104.23.243.33 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/cp648411/www/simded.com/loginfacebook/ |
Upload File : |
<script>
// This is called with the results from from FB.getLoginStatus().
function statusChangeCallback(response) {
console.log(response);
if (response.status === 'connected') {
loginfb();
} else {
console.log('Please log into this app.');
//document.getElementById('status').innerHTML = 'Please log ' + 'into this app.';
}
}
function checkLoginState() {
FB.getLoginStatus(function(response) {
statusChangeCallback(response);
});
}
window.fbAsyncInit = function() {
FB.init({
appId : '1368896923231634', // id facebook
//appId : '934354504232992', // id test facebook
cookie : true,
xfbml : true,
version : 'v2.9'
});
FB.AppEvents.logPageView();
FB.getLoginStatus(function(response) {
statusChangeCallback(response);
});
};
(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 = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
function testAPI() {
// console.log('Welcome! Fetching your information.... ');
FB.api('/me',{fields: 'name,email,gender,first_name,last_name'}, function(response){
$.ajax({
url: "../loginfacebook/ajax_fb.php",
data:{fbpost:response},
type:'POST',
success: function(result){
// $("#alert_login_member").html(result);
}
});
});
}
function loginfb() {
FB.api('/me',{fields: 'name,email,gender,first_name,last_name'}, function(response){
$.ajax({
url: "../loginfacebook/ajax_fb.php",
data:{fbpost:response},
type:'POST',
success: function(result)
{
if (result == 1) {
$('#myModal_login_User').modal('hide')
window.location.href = '../home/index.php';
}
}
});
});
}
</script>