user2731173
user2731173

Reputation: 25

JQuery Post will not work

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

Answers (1)

Rohan Kumar
Rohan Kumar

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

Related Questions