Hello!
I have a problem using PHP built-in cUrl library. I'm trying to send post data through proxy servers, but combination proxy+post data seems not to work. This is the fragment of code:
Code:
$cUrl = curl_init();
curl_setopt($cUrl, CURLOPT_URL, $requestUrl);
curl_setopt($cUrl, CURLOPT_POST, 1);
curl_setopt($cUrl, CURLOPT_POSTFIELDS, $postField.$value);
curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cUrl, CURLOPT_TIMEOUT, '10');
curl_setopt($cUrl, CURLOPT_REFERER, $referer);
curl_setopt($cUrl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11');
curl_setopt($cUrl, CURLOPT_PROXY, $proxy);
curl_exec($cUrl);
curl_close($cUrl);
When I comment out the proxy section, everything works fine. When I comment out POST section and uncomment proxy, everything also works fine. But I can't get them to work together! What's wrong? May it be a bug? My server configuration:
Apache 2.0.47 (without OpenSSL) on Windows XP
PHP 5.1.6 with built-in cUrl library
I'd really appreciate some help!