If I were to save a webpage onto a file, I know that the following simple code works (I have tried it):
$url = "http://www.whateversite.com
$ch = curl_init($url);
$fp = fopen("myfile.txt", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
However, if the variable $url actually holds a dynamically generated URL (that can display on a browser ONLY AFTER logging to a website), the above would not work. For example, I tried doing $url = "http://us.f621.mail.yahoo.com/ym/ShowFolder?rb=Inbox&reset=1&YY=92315&y5beta=yes&y5beta=yes&inc=25&order=down&sort=date&pos=0&view=a&head=b&box=Inbox"; (which is the URL to my Yahoo mail inbox, which can be accessed obviously only after I log in.)
and it didn't work........
I know that I have to handle cookies somehow (I've tried curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); and the whole deal) without luck. I keep getting a blank file as a result.
Anyone can help?