Jump to content

Generate static html


Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.