2011-07-31 37 views
0

我想要獲得Apply與LinkedIn插件返回的響應。我正在使用Zend Framework。我已經使用示例代碼從LinkedIn處理應用程序響應從應用與linkedin

<?php 
// access raw HTTP POST data 
$post_body = file_get_contents('php://input'); 
$application = json_decode($post_body); 

// confirm success by writing applicant name to the error log 
error_log($application->person->firstName . " " . $application->person->lastName); 

// now parse $application and insert data into a DB 
// or perform another action 
?> 

在我的控制器貼上這個,然後我的看法,但沒有成功嘗試。

我的data-url是當前頁面的url ... 任何人都可以告訴我這是如何做PHP或JavaScript(需要獲得響應到數據庫中)。

謝謝。

回答

0

嘗試更換

$post_body = file_get_contents('php://input'); 

有了:

$post_body = $this->getRequest()->getRawBody(); 

其中$ this指的是當前的請求。如果你免費得到這個,我不積極......但是我希望你能從這裏獲得這個。我不是ZF專家。