hostingknowledge
09-06-2005, 11:55 PM
Sorry if this a dumb question, but I would like to include header.php and footer.php file to .html file, does anyone know how to do this?
Thanks!
Thanks!
![]() | View Full Version : Ssi hostingknowledge 09-06-2005, 11:55 PM Sorry if this a dumb question, but I would like to include header.php and footer.php file to .html file, does anyone know how to do this? Thanks! sea otter 09-07-2005, 12:33 AM Hi p_s_p, welcome to WHT! You can't include anything in an html file, because html files are served statically by the web server -- they aren't processed by an engine (like php), so there's no concept of "include". Basically, you would have to make the html file a php file, and include the header and footer in that. The reason I'm not being more specific is because this can get complicated, and I'm not sure what will be in the header and footer. The footer's easy, because you just include it right before </body></html>. But the header's more complicated: does it include pre-processing code or code that goes in the <head> section of the html document or both? Or is it simply code that goes at the top of the <body> section? Hope this helps! Marble 09-07-2005, 01:08 AM You can make an AddHandler in .htaccess to parse .html files with the php engine. This kind of sums it up: http://www.thesitewizard.com/archive/dynamicstatic.shtml Also you can use mod_rewrite to make php look like .html klasje 09-08-2005, 06:42 PM Indeed, sea otter is wrong. It can be done :-) sea otter 09-08-2005, 06:47 PM well yes, there are plenty of other ways to do it. But...right tool for the right job, no? Just my opinion :) klasje 09-08-2005, 06:57 PM Correct :-) Php parser for php :cartman: |