Using a single Header/Side bar on multiple pages without Frames

aka Rohan's picture

He has: 200 posts

Joined: Feb 2006

Is there a way I can have a header and sidebar that is called up on every page from a single location in html without resorting to frames?

At the moment if i ned to make a change to my sidebar say, I have to go through every page in turn making said change which is tedious at best.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

There are two ways to do this - server side includes or PHP. I forget what the SSI syntax is but you can look it up. For PHP it just looks like this:

<?php
include "yourfile.html";
?>
'

Of course, now all your files need to have .php extensions.

aka Rohan's picture

He has: 200 posts

Joined: Feb 2006

Sweeeet, thanks Megan Laughing out loud

Is there a simple way/program for viewing .php pages without php installed. In otherwords on my home PC without having to upload them to the server?

He has: 1,758 posts

Joined: Jul 2002

Monkeyboy;215447 wrote: Is there a simple way/program for viewing .php pages without php installed. In otherwords on my home PC without having to upload them to the server?

XAMPP is a real easy way.

Andy

They have: 64 posts

Joined: Apr 2006

Yes you can get a combined apache mysql server set up that will install on your machine and parse the pages nicely for you.

But I am buggered if I can remember the name of the script Sad

aka Rohan's picture

He has: 200 posts

Joined: Feb 2006

Ah ok, so I guess the only way is to install server software. I was hoping there might be a php editor type program which could emulate a server running php but hey ho.

andy206uk;215464 wrote: XAMPP is a real easy way.

I actually stumbled across that yesterday, does look pretty simple to install. I guess that's the way forward then. Cheers guys Smiling

aka Rohan's picture

He has: 200 posts

Joined: Feb 2006

Megan;215441 wrote: There are two ways to do this - server side includes or PHP.

Which is best? Currently I'm using php includes, but should I be using server side includes instead?

demonhale's picture

He has: 3,278 posts

Joined: May 2005

oh and you can use htaccess to let even html be read as php...

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.