how to send data to a HTTP web server using libcurl
how to send data to a HTTP web server using libcurl
Collapse
X
-
Tags: None
-
Using PHP:
[PHP]$url_to_send_da ta_to = "http://www.someurl.com/somepage.php";
$ch = curl_init($url_ to_send_data_to ); [/PHP]
You can then set options like this - there are more options than this, so do some research on how you want to set your options:
[PHP]curl_setopt($ch , CURLOPT_HEADER, 0);
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_POSTFIE LDS,$fields);[/PHP]
Then you send the requst:
[PHP]$resp = curl_exec($ch);
curl_close ($ch);[/PHP]
The variable $resp above holds the response from the server.
Hope that helps.
Greg
Comment