Jump to content

CURLOPT_FOLLOWLOCATION set to FALSE but redirects!


Arunkumar15

Recommended Posts

Hi folks,

This is the first time I'm using phpfreaks.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);

 

I'm being redirected to url http://actas.rfef.es...s/NLogin..which is just 0 byte blank page.what I'm doing wrong?

Please provide me suggestions,ideas,and correct code to grab the html of that page.

Thanks in advance

Works for me.

HTTP/1.1 302 Movido temporálmente
Date: Fri, 01 Feb 2013 07:45:09 GMT
Server: Apache/2.2.3 (Red Hat)
Set-Cookie: JSESSIONID=189E1AE60B58965957A9543F8E3623A2; Path=/actas
Location: http://actas.rfef.es/actas/NLogin
Content-Length: 0
Connection: close
Content-Type: text/plain; charset=UTF-8

 

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.