2016-05-15 105 views
2

我有一個PHP的AJAX請求,但它沒有返回正確的數據。PHP AJAX POST獲取錯誤的數據

我的AJAX請求:

$.ajax({  
    type: "POST", 
    url: 'http://www.boomlings.com/database/getGJUserInfo20.php', 
    contentType: 'application/x-www-form-urlencoded', 
    dataType: "text", 
    crossDomain: true, 
    data: { 
      gameVersion: 20, 
      binaryVersion: 29, 
      str: 'Nexrem', 
      page: 0, 
      total: 0, 
      secret: 'Wmfd2893gb7' 
    }, 
    success: function (response) { 
     console.log('success:') 
     console.log(response) 
    }, 
    error: function(erresponse){ 
     console.log('error:') 
     console.log(erresponse) 
    } 
}); 

這個總是返回-1而不是數據串。

我俘獲了我的AJAX請求的數據包和工作的請求(官方客戶端)

enter image description here

礦左側和官員的權利。

官方似乎收到的數據字符串,但我沒有。我不確定我可能會做錯什麼。

我也可以提供我正在與之通信的PHP,但請注意,我不能也不會修改它。 https://github.com/Cvolton/GMDprivateServer/blob/master/getGJUserInfo20.php

+1

返回-1其中? in'console.log(response)'?你在哪裏發送在那個鏈接的php中使用的「targetAccountID」? – Jeff

+0

@Jeff是在控制檯日誌中。不,str是targetAccountID。我大多被一個python腳本引用,它可以實現這一點並且可以工作。 http://pastebin.com/Hauy0uJu – meganukebmp

+0

那麼它可能是錯誤是數據庫?也許connection.php返回-1並停止腳本已經? – Jeff

回答

0

人爲錯誤。鏈接是錯誤的。我使用GetUserInfo20.php而不是GetUsers.php