using:
function curl_getNoFollow($url, array $get = NULL, array $options
= array() ){
$defaults = array(
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_FORBID_REUSE => 1,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYPEER =>0,
CURLOPT_COOKIEFILE => '/tmp/cookies.txt',
CURLOPT_COOKIEJAR=> '/tmp/cookies.txt',
CURLOPT_HEADER =>TRUE,
CURLINFO_HEADER_OUT => TRUE,
CURLOPT_FOLLOWLOCATION =>FALSE,
CURLOPT_USERAGENT =>'Mosilla/5.0(Windows NT 6.1,;WOW64,rv21.0)
Gecko/20100101 Firefox/21.0)',
);
$ch = curl_init();
curl_setopt ($ch,CURLOPT_URL, $url);
curl_setopt_array($ch, ($options + $defaults));
$result = curl_exec($ch);
$eurl = curl_getinfo($ch,CURLINFO_EFFECTIVE_URL);
$http =curl_getinfo($ch,CURLINFO_HTTP_CODE);
$resultx =array($result, $eurl, $http,); // result is an
array($result, $eurl, $http)
curl_close($ch);
return $resultx;
}
I get:
url:
http://www.mydomain.com/login/login.cfm, http: 302
note the lack of information about the refer to address, which I
need so I can follow.