maddogandnoriko Posted May 17, 2009 Share Posted May 17, 2009 I have some pages that have pretty basic php in them to include common sidebars and the site title and footer etc. I am trying to generate static html from said pages for transfer to a portable device w/o internet connection. I was using the following function, but it is just copying the php files, when I want to copy the generated html. Thank you Todd function wwwcopy($link,$file){ $content=''; $fp = @fopen($link,"r"); while(!feof($fp)){ $content.= fread($fp,1024); } fclose($fp); $content=replace_filenames($content); $fp2 = @fopen($file,"w"); fwrite($fp2,$content); fclose($fp2); } Link to comment https://forums.phpfreaks.com/topic/158499-generate-static-html/ Share on other sites More sharing options...
Masna Posted May 17, 2009 Share Posted May 17, 2009 View source? Link to comment https://forums.phpfreaks.com/topic/158499-generate-static-html/#findComment-835939 Share on other sites More sharing options...
maddogandnoriko Posted May 17, 2009 Author Share Posted May 17, 2009 pretty much view source but I have a list of files to do and wanted a separate script to get the html from them. But yes, the same as view source in my browser. todd Link to comment https://forums.phpfreaks.com/topic/158499-generate-static-html/#findComment-835953 Share on other sites More sharing options...
maddogandnoriko Posted May 17, 2009 Author Share Posted May 17, 2009 I've narrowed my problem a bit. I am pretty sure it is a path problem.....the problem is this may not always run from my localhost. Any ideas? this works: wwwcopy('http://localhost:8888/bluenose/index.php', 'html/bluenose/index.html'); This does not: wwwcopy('./bluenose/index.php', 'html/bluenose/index.html'); Todd Link to comment https://forums.phpfreaks.com/topic/158499-generate-static-html/#findComment-836027 Share on other sites More sharing options...
BK87 Posted May 18, 2009 Share Posted May 18, 2009 I'm not sure what you are trying to do exacly but I think you want a proccessed html to be saved ? use file_get_contents("http://www.site.com/page.html") then just save it... Link to comment https://forums.phpfreaks.com/topic/158499-generate-static-html/#findComment-836098 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.