Jump to content

curl works from command line but not browser?


michaellunsford

Recommended Posts

<?php
$myvar="http://www.example.com?somegetvar=someval&anothergetvar=someval"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $myvar);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch) ;
curl_close($ch);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.