I am trying to open a file off the web, grab 1 piece of information from it and store it in a file on my server. I can grab the file off the web, and prin the value i want, but i cannot insert it into the file on my server. Hopefully someone has some ideas, here is my code:
<?
// Open file off web
if (!($readfile = fopen("http://www.ny.frb.org/pihome/statistics/forex12.shtml", "r")))
{
print("Could not open");
exit;
}
while(!feof($readfile))
{
$printfile = fgetss($readfile, 150);
$printfile = strstr($printfile, "Canada");
$printfile = strstr($printfile, "Dollar");
$printfile = strstr($printfile, "1.");
echo"$printfile";
$myFile = fopen("data.php3", "w");
fputs($myFile, $printfile);
fclose($myFile);
}
fclose($readfile);
?>