blank response by curl when posting form data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • apinti@gmail.com

    #1

    blank response by curl when posting form data


    Here is my code, and the problem:

    $st="...(string to post is formed from different variables read from
    file)...";
    $lngth=strlen($ st);
    $ch = curl_init();
    curl_setopt($ch , CURLOPT_SSL_VER IFYPEER, 0);
    curl_setopt($ch , CURLOPT_URL, $url2);
    $fp = fopen("example_ homepage2.txt", "w");
    curl_setopt($ch , CURLOPT_CONNECT TIMEOUT,20);
    curl_setopt($ch , CURLOPT_HEADER, 0);
    curl_setopt($ch , CURLOPT_RETURNT RANSFER,1);
    curl_setopt($ch , CURLOPT_REFERER , $url);
    curl_setopt($ch , CURLOPT_FILE, $fp);
    curl_setopt($ch , CURLOPT_COOKIEF ILE, "cookie.txt ");
    curl_setopt($ch , CURLOPT_FOLLOWL OCATION, 1);
    curl_setopt($ch , CURLOPT_POST, 1);
    curl_setopt($ch , CURLOPT_POSTFIE LDSIZE, $lngth);
    curl_setopt($ch , CURLOPT_POSTFIE LDS, $st);
    $page2=curl_exe c($ch);
    curl_close($ch) ;
    fclose($fp);

    I tried both with and without POSTFIELDSIZE option, with same result.
    This code works fine for strings smaller than 800 characters (actually
    795 or so), but my regular string is just under 13000 characters.
    I have uploaded the script to 5 webservers (including my development
    machine with Win XP , PHP 5 and Apache 2.2.) and it only works on one.
    The rest return a blank page to stare at on the curl post.
    Is this some configuration issue, or a curl issue?
    Any advice?

Working...