02-01-2013, 05:50 AM
|
#1 (permalink)
|
|
The Visitor
Join Date: Feb 2013
Posts: 1
Thanks: 0
|
CURLOPT_FOLLOWLOCATION redirection issue
Hi folks,
This is the first time I'm using talkPHP.Hope I'll get a quick solution.
I'm trying fetch HTML of page which is publicly accessible.
here is the code I used.
$home="http://actas.rfef.es...ctas/NPortada";
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$home);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_HEADER, TRUE);
curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:18.0)Gecko/20100101 Firefox/18.0");
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, FALSE);
curl_setopt($ch,CURLOPT_COOKIEJAR, "cookies.txt");
echo curl_exec($ch);
curl_close($ch);
Why it redirects even followLocation set to false? How can I avoid being redirected and get html of targeted page?What I'm doing wrong.
I'm struggling with this problem for last 3 days..Please anyone help me on this.Thanks in advance.
|
|
|
|