...

View Full Version : can PHP be a solution?



ssskaya
01-15-2004, 06:25 PM
my website is growing day by day with new pages.

I am not using any frames on it, and so I have to insert the same header, footer and the menu to each page.

when I am making a change it is becoming more of a trouble day by day - since I am not using a content management system like phpnuke or so.

is it possible that I write just one, shall we say, menu/header/footer script, and apply it to all pages by simply referencing to it?

can php do that?

if not, what else can you recommend?

thanks!

Nightfire
01-15-2004, 06:36 PM
You can do this by using includes :)

example
header.php


<html>
<head>
<title>Website name</title>
</head>
<body>

footer.php


<p>Footer text</p>
</body>
</html>

index.php


<?php
include("header.php");
?>
This text is now in the body
<?
include("footer.php");
?>

ssskaya
01-15-2004, 07:17 PM
Thanks for the reply.

to give it a bit of depth:

I will put them in tables of a regular .html file.

So, if my menu.php file itself is actually a table with a width of 90%, will I have to make any modifications?

Thanks!

Nightfire
01-15-2004, 07:24 PM
If your html was fine before, then you shouldn't have to change anything

ssskaya
01-15-2004, 07:25 PM
Thanks a lot for your time.

One last question: is php the only option or could this be done by other term in html?

Thanks.

Nightfire
01-15-2004, 07:30 PM
In html, you could use iframes, can't think of any other way

ssskaya
01-15-2004, 09:55 PM
I did it all and it works great!

Thanks a lot!

Celtboy
01-16-2004, 05:00 AM
A non-php method = server side includes! (SSI):

<!--#include file="header.htm" //-->



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum