Reputation: 25
I'm trying to post some data with a jquery post to another page, and I don't know why it's not working.
FB.getLoginStatus(function(response){
if (response.status == 'connected'){
var uid = response.authResponse.userID;
$.post('checkFBLogin.php', uid)
}
I try to read it in that page like this:
$fb_id = $_POST['uid'];
I then use that value to find a match in my database, but I don't think it even makes it that far. Does anyone know what may be wrong with my post?
Upvotes: 1
Views: 248
Reputation: 40639
Use {uid:uid} in place of uid like,
if (response.status == 'connected'){
alert('Test: Connected');
var uid = response.authResponse.userID;
$.post('checkFBLogin.php', {uid:uid});
}
Upvotes: 2