LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-17-2007, 08:26 AM   #1
elvijs
LQ Newbie
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware
Posts: 15

Rep: Reputation: 0
PHP: cUrl - post data doesn't go through proxy


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!

Last edited by elvijs; 12-17-2007 at 08:28 AM.
 
  


Reply

Tags
curllibrary


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
POST data to PHP code ckoniecny Programming 6 03-02-2006 10:48 PM
PHP Question about POST data BrianK Programming 7 11-26-2005 01:33 PM
php, apache, POST/GET data jhaiduce Linux - Software 0 12-17-2003 04:02 PM
Trouble recognising 'post' data in a php file davee Programming 4 10-20-2003 12:29 PM
php post data sql queries... bulliver Programming 2 01-03-2003 02:18 AM


All times are GMT -5. The time now is 07:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration