2015-10-02 39 views
0

我想執行以下代碼捲曲:捲曲錯誤 - 資源ID#88

$URL = "https://app.getresponse.com/add_subscriber.htm"; 
$post_data = "name=ABC&[email protected]&campaign_token=poga1&start_day=0&"; 


$ch = curl_init(); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); 
curl_setopt($ch, CURLOPT_URL, $URL); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_exec($ch); 
curl_close($ch); 

運行該捲曲給出:資源ID#88

任何線索?

+0

謝謝你的代碼;我不認爲這是一個cUrl錯誤,但[PHP的](https://stackoverflow.com/questions/6592067/mysql-resource-id)。這對你有幫助嗎?你可能會在腳本的末尾加上「echo」$ ch「;'。 –

+0

你試過類似'$ result = curl_exec($ ch);'然後做'echo $ result;'? – Touchpad

+0

[Curl返回'資源ID#2'作爲響應原因的可能的重複]](http://stackoverflow.com/q/26066015) – mario

回答

0
$URL = "https://app.getresponse.com/add_subscriber.htm"; 
    $post_data = "name=ABC&[email protected]&campaign_token=poga1&start_day=0&"; 

    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); 
    curl_setopt($ch, CURLOPT_URL, $URL); 
    curl_setopt($ch, CURLOPT_POST, true); 
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    $response = curl_exec($ch); 
    curl_close($ch); 
    echo "<pre>"; 
    print_r($response); 

的問題是你有沒有分配捲曲執行的響應