Jump to content

Changing Only The Body


packedpluto
 Share

Recommended Posts

Hi, I'm wondering what language you use to leave the Header, Footer, and Sidebars the same and only change the body when you click on something? I don't want to have to re-write all that info into every page. I'm sorry if this has already been answered before. I've noticed it mostly on blogs, but I think it's a commonly used method.

Link to comment
Share on other sites

I guess I'll have to finish the php tutorial. I had gotten half way through it, and hadn't figured out how to do it with that yet. Thanks for the speedy reply!
Do you know if your server has PHP? Most do. Here is the entire code you need to do an include:<?php include ("sys-config.php");?>In context it could look like this:<DOCTYPE....><html><head><title...></head><body><?php include ("your_heading.php"); include ("your_menu.php");?>stuff<?php include ("your_footer.php");?></body></html>You could have a side menu and you probably would include css and divs.
Link to comment
Share on other sites

Just a word of advice: if including files with PHP, always use .php endings and never .inc endings unless you know how to use Apache to block access to those files. People can come in and steal snippets with .inc endings.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...