curl getting results

by Prakash 2013-10-05 10:35:32

Use the following code to send a curl request and retrieve the results :


$query = "http://sitename.com?param1=sample¶m2=sample2";

$curl = curl_init(); # Create Curl Object
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0); # Allow self-signed certs
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0); # Allow certs that do not match the hostname
curl_setopt($curl, CURLOPT_HEADER,0); # Do not include header in output
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); # Return contents of transfer on curl_exec
curl_setopt($curl, CURLOPT_URL, $query);
$result = curl_exec($curl); # execute the query
print_r($result);


In the above code change the sitename to be an appropriate one.

Tagged in:

884
like
0
dislike
0
mail
flag

You must LOGIN to add comments