【问题标题】:Curl Error - Resource id #88卷曲错误 - 资源 ID #88
【发布时间】:2015-10-02 06:37:59
【问题描述】:

我正在尝试执行以下 curl 代码:

$URL = "https://app.getresponse.com/add_subscriber.htm";
$post_data = "name=ABC&email=myemail@gmail.com&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);

运行这个 curl 给出:资源 id #88

有什么线索吗?

【问题讨论】:

  • 感谢您的代码;我不认为这是 cUrl 错误,而是 a PHP one。这对你有帮助吗?您的脚本末尾可能有echo "$ch";
  • 你尝试过$result = curl_exec($ch); 之类的方法,然后再尝试echo $result;

标签: php curl libcurl


【解决方案1】:
    $URL = "https://app.getresponse.com/add_subscriber.htm";
    $post_data = "name=ABC&email=myemail@gmail.com&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);

问题是你没有指定 curl 执行的响应

【讨论】:

    猜你喜欢
    • 2015-09-02
    • 1970-01-01
    • 2011-10-31
    • 1970-01-01
    • 2017-07-06
    • 2015-04-18
    • 2018-11-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多