473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

cURL Post through proxy

TheMadMidget
I'm trying to using cURL to send a Post variable and through a proxy server. I know how to send requests through a proxy server or how to do post variables. I tried to combine them, but it doesn't work. The code I'm posting work as it should if I comment out either the proxy or the two post lines, but not as is.

[PHP]
$ch = curl_init("http://mysite.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, "myproxyip");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "field=value");
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$data = curl_exec ($ch);
curl_close($ch);

print $data;
[/PHP]
May 21 '07 #1
0 1724

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Dave Martin | last post by:
I've successfully used CURL to maneuver around and through sites but a new site I've been trying to work with has got me stumped. To retrieve the data I'm trying to get a login is required. If...
7
by: lawrence k | last post by:
I'm reading over this page: http://www.php.net/manual/en/ref.curl.php What I'm missing is why? What problem does curl solve? What does it make easier? When would I use its functions, instead...
1
by: yawnmoth | last post by:
I was looking at the various cURL options and have a few questions. CURLOPT_HTTPPROXYTUNNEL's being set to true is supposed to tunnel through a given HTTP proxy. Afaik, tunneling is only...
0
by: nfhm2k | last post by:
I've been trying to find a solution to this for quite some time now... I even took a look at existing scripts... Including this one......
1
by: devranger | last post by:
Hello, I am in the process of learning PHP CURL and in doing some test examples I am having some issues with CURL that I do not fully understand. I am doing a test to use CURL to post and return...
4
by: zorro | last post by:
Hello there, I can't figure out why is it that when i use an array for my postfields it doesn't work : this works curl_setopt($curl, CURLOPT_POSTFIELDS, "clown=bozo" ); this doesn't...
1
by: GeoffreyF67 | last post by:
There is a social bookmarking site here: http:// onlywire.com that I'm trying to login and post to via curl. It's using ajax and I haven't been able to figure out how to post to it so far. ...
3
by: JDS | last post by:
So, I'd like to create the following scenario: 1) Use cURL library within PHP (cURL + "Cookie Jar", et.al) to create a virtual browser session that "logs in" to a remote site. (For example: ...
0
by: sebastianrs | last post by:
Hello, I have a serious problem with a script using cURL to access a site using various different proxies. It appears that the PHP script always stops executing if the connection to the proxy...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.