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); } Quote Link to comment Share on other sites More sharing options...
Masna Posted May 17, 2009 Share Posted May 17, 2009 View source? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.