Thread: PHP Question
View Single Post
Old 12-31-2003, 07:11 AM  
Nightwork
Registered User
 
Join Date: Oct 2003
Posts: 61
at your service, asher ;)

keydet, copy wouldn't do the trick, because it will copy the actual source of the .php file, not the parsed result.

pornanza, that's basically the idea, but the fwrite for the html tags would generate errorous html, because the parsed result already contains the tags.

PHP Code:
//open page
$fd=fopen("http://www.server.com/galleries.php","r");

//retrieve contents (eof won't work with remote filereading)
while ($line=fgets($fd,1000))
{
$alltext.=$line;
}
fclose ($fd);
//open local file (or create if doesn't excist, check for correct 
//permissions in dir, pointer set to begin of file
$out fopen("galleries.html""w");
//write retrieved content
fwrite($out$alltext);
fclose($out); 
^ the used code, enjoy
__________________
God may have created the world in 6 days, but you can bet your ass that while he rested on the 7th, a programmer coded it all.<br>ICQ:48322442
Nightwork is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote