TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-01-2013, 05:50 AM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Feb 2013
Posts: 1
Thanks: 0
Arunkumar15 is on a distinguished road
Default 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.
Arunkumar15 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Static Method Issue captainmerton Advanced PHP Programming 1 01-28-2012 08:45 AM
Str _replace Issue Tim Dobson Absolute Beginners 2 03-05-2011 06:29 PM
Template Class Issue tego10122 Advanced PHP Programming 1 12-28-2010 07:08 PM
Frustrating PNG Issue on IE 6 aristoworks XHTML, HTML, CSS 5 11-10-2008 08:18 AM
Session / Cookie Issue? dav Feedback 3 12-30-2007 07:57 PM


All times are GMT. The time now is 11:22 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design