ari_aaron Posted May 7, 2006 Share Posted May 7, 2006 how can I make HTML code from 1 file go into every one.I need something like:[code]<html><head><title>Home</title></head><header.html><!---page content><footer.html></html>[/code]also, it there a way to open tags in the other files, and close them in this file? Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 7, 2006 Share Posted May 7, 2006 Use html includes - you don't need php at all. Excellent tutorial at [a href=\"http://bignosebird.com/ssi.shtml\" target=\"_blank\"]http://bignosebird.com/ssi.shtml[/a] Quote Link to comment Share on other sites More sharing options...
neylitalo Posted May 7, 2006 Share Posted May 7, 2006 If your server has PHP installed on it, you can use the auto_prepend_file and auto_append_file directives in .htaccess. Just put the top half (everything above the body content) in the auto_prepend_file directive, and everything below the body content in the auto_append_file directive. It'll automatically put the contents of those files at the top and bottom, respectively, of all PHP scripts. Quote Link to comment Share on other sites More sharing options...
ari_aaron Posted May 7, 2006 Author Share Posted May 7, 2006 The HTML inludes don't work on .php files. only .shtmlauto_prepend_file and auto_append_file arn't good because the title is diffrent on each page. Quote Link to comment Share on other sites More sharing options...
Michael4172 Posted May 7, 2006 Share Posted May 7, 2006 Why not just use the php includes?[code]<?php include("somefile.php"); ?>[/code] Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 7, 2006 Share Posted May 7, 2006 [!--quoteo(post=372102:date=May 7 2006, 04:10 PM:name=ari_aaron)--][div class=\'quotetop\']QUOTE(ari_aaron @ May 7 2006, 04:10 PM) [snapback]372102[/snapback][/div][div class=\'quotemain\'][!--quotec--]The HTML inludes don't work on .php files. only .shtml[/quote]If you had mentioned that ...Then use php includes: example[code]<html><head><title>Home</title></head><?php include("header.html"); ?><!---page content><?php include("footer.html"); ?></html>[/code] Quote Link to comment Share on other sites More sharing options...
ari_aaron Posted May 7, 2006 Author Share Posted May 7, 2006 this is a php forum....anyway, thank you, that is what I needed. 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.