2014-01-06 20 views
0

我正在使用web hook從我們公司的註冊頁面獲取用戶詳細信息。無法獲取數據發佈者webhook in JSON字符串

以JSON格式從註冊頁面發佈的數據。發佈JSON字符串低於

{"FirstName":"dharampal","EmailAddress":"[email protected]","Mobile":"123456789","Company":"Instasafe","LandingPageURL":"http://instasafe.com/SignUp","LandingPageId":"11e2-b071-123141050daa"} 

在接收端,我們使用PHP笨,我想下面的方法,但無法獲取數據。

$postedData = $_POST; 
print_r($postedData); 

它給出:空數組

其他方法我嘗試是:

$postedData = json_decode(file_get_contents('php://input'), TRUE); 

print_r($postedData); 

它給出:NULL

+0

json字符串是發佈數據的主體?你能告訴我們如何發佈數據嗎? – chanchal118

+0

我們使用LeadSquared登陸頁面進行營銷,他們以JSON格式發送數據,並且數據位於給定字符串之上。請在接收端告訴我,我做得對嗎? –

回答

0

好像問題是與$ostedData$postedData

一個錯字
$ostedData = json_decode(file_get_contents('php://input'), TRUE); 
print_r($postedData);