Arunkumar15 Posted February 1, 2013 Share Posted February 1, 2013 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 Link to comment https://forums.phpfreaks.com/topic/273895-curlopt_followlocation-set-to-false-but-redirects/ Share on other sites More sharing options...
requinix Posted February 1, 2013 Share Posted February 1, 2013 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 Link to comment https://forums.phpfreaks.com/topic/273895-curlopt_followlocation-set-to-false-but-redirects/#findComment-1409454 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.