|
|
| How to use CURL
|
|
<?php
//How to connect using cURL
$ch = curl_init("FULL URL OF SERVER TO POST THE STRING TO"); //URL of gateway for cURL to post to
curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($ch, CURLOPT_POSTFIELDS, $VAR; // use HTTP POST to send form data
### VAR as listed above is the variable that contains the info that is to be sent to the remote host
$resp = curl_exec($ch); //Execute post and set the results as the $resp variable
curl_close ($ch);
echo $resp; //This will echo the complete response from the remote host, and you can parse as you see fit
?>
|
|
|