Problem with curl
Posted: Wed Aug 27, 2008 5:41 pm
I am trying to use this script and I am getting this error on the page "Parse error: parse error, unexpected T_GLOBAL in d:\websites\gatormaniacscom\test2.php on line 11" My host does have curl enabled and they think it's a coding error possible due to a missing colon or a space somewere? Any help would be appreciated. Here is the code
<? php
global $IPAddress,$_SERVER,$UserAgent,$PageURL,$URL;
$IPAddress = urlencode($_SERVER['REMOTE_ADDR']);
$UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']);
$PageURL = urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING ']);
$URL = "http://si.goldencan.com/GetData.aspx=1C ... 827381FF99;"
$URL = $URL.'&IPAddress='.$IPAddress;
$URL = $URL.'&UserAgent='.$UserAgent;
$URL = $URL.'&PageURL='.$PageURL;
readFile($URL);
$goldencanurl=$URL.'&PageURL='.$PageURL.'&IPAddress='.$IPAddress.'&UserAgent='.$UserAgent;
// create a new CURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "$goldencanurl");
curl_setopt($ch, CURLOPT_HEADER, false);
// grab URL and pass it to the browser
curl_exec($ch);
// close CURL resource, and free up system resources
curl_close($ch);
?>
<? php
global $IPAddress,$_SERVER,$UserAgent,$PageURL,$URL;
$IPAddress = urlencode($_SERVER['REMOTE_ADDR']);
$UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']);
$PageURL = urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING ']);
$URL = "http://si.goldencan.com/GetData.aspx=1C ... 827381FF99;"
$URL = $URL.'&IPAddress='.$IPAddress;
$URL = $URL.'&UserAgent='.$UserAgent;
$URL = $URL.'&PageURL='.$PageURL;
readFile($URL);
$goldencanurl=$URL.'&PageURL='.$PageURL.'&IPAddress='.$IPAddress.'&UserAgent='.$UserAgent;
// create a new CURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "$goldencanurl");
curl_setopt($ch, CURLOPT_HEADER, false);
// grab URL and pass it to the browser
curl_exec($ch);
// close CURL resource, and free up system resources
curl_close($ch);
?>