PHP:
<?php
// this must be done somehow how you want
$filename = 'mobile.php';
$handle = fopen("http://us.m.yahoo.com/w/yfinance?.intl=us&.lang=en&t=ms", "rb");
if($handle){
$somecontent = stream_get_contents($handle);
$handle = fopen($filename, 'wb');
// $stringData = "start\n";
fwrite($handle, $stringData);
if($handle){
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";
// $stringData = "end\n";
fwrite($handle, $stringData);
fclose($handle);
}else{
echo "Cannot create file ($filename)";
exit;
}
}
chmod($filename, 0777);
?>
This script is used to copy the content of a page (Fallback Widget) then save it to my server as mobile.php file.
When i execute the script above, it printed this message
The website could not set or retrieve your cookies.
The browser may not support cookies or the cookies may be turned off. Please ensure cookies are enabled and retry.
Anyone knows how to send cookies to that website so that we can copy the content of the page?
Thanks.






