Jump to content

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

Edited by Arunkumar15

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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.