|
Posted by apinti on 11/22/06 07:46
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_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url2);
$fp = fopen("example_homepage2.txt", "w");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,20);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDSIZE, $lngth);
curl_setopt($ch, CURLOPT_POSTFIELDS, $st);
$page2=curl_exec($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?
Navigation:
[Reply to this message]
|