The Praetorian Posted September 2, 2006 Share Posted September 2, 2006 I may be asking this in the wrong section. Not sure if the whole <!-- INCLUDE --> thing is html or not. Anyway, I've been working alot lately with phpbb, for my forums, and alot of the pages are built by using <!-- INCLUDE --> to paste several pieces together into one page. Header, three or four different files for the middle, and footer.My question is... is that possible to do with html? Specifically on any of these pages. Would it be possible for me to put my menu into a separate file and use <!-- INCLUDE menu.html --> or something to that effect, to put the menu in without having to repeat the same text over and over on each page?If it is possible, how exactly would I do that? Link to comment Share on other sites More sharing options...
Err Posted September 2, 2006 Share Posted September 2, 2006 You can check out this page. It has already been covered there. Link to comment Share on other sites More sharing options...
The Praetorian Posted September 2, 2006 Author Share Posted September 2, 2006 Okay, thanks. Just a few questions about that though. It says the php method will work with pages that are .shtml. Would everything else be the same?IE..The menu file would be menu.php, and the include would be <?php include("menu.php"); ?> ?EDIT: Tried this, and it didn't work. Saved the menu file as a php, and used the php include in a .shtml file, but nothing happened. Link to comment Share on other sites More sharing options...
boen_robot Posted September 2, 2006 Share Posted September 2, 2006 The file that will include the PHP file must also be a PHP file itself. Your server is also expected to support PHP. If it doesn't, this won't work.Also, note that what you are showing is not exactly HTML. It's Server parsed HTML (SHTML). Apache is responsible for including the content. But SSIs must be enabled on the server you're using. The fact that files with *.shtml extension work doesn't mean much before you get aload of the extaras.See Introduction to SSIs. Link to comment Share on other sites More sharing options...
The Praetorian Posted September 2, 2006 Author Share Posted September 2, 2006 My server does support SSI. I'm actually using it for my meta tags. Someone in the other thread said that shtml would work for the php include thing. Is that not true? Link to comment Share on other sites More sharing options...
boen_robot Posted September 2, 2006 Share Posted September 2, 2006 My server does support SSI. I'm actually using it for my meta tags. Someone in the other thread said that shtml would work for the php include thing. Is that not true?Nope. Certanly not true. You must have misunderstood him. Link to comment Share on other sites More sharing options...
The Praetorian Posted September 2, 2006 Author Share Posted September 2, 2006 Drat. Well thanks anyway. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now