Click to See Complete Forum and Search --> : Page Header


ts01
09-05-2006, 03:34 PM
Hi there,

Im a novice with php but can i use it to add a header section to the top of each page on my site instead of using frames etc.

So all i would do is add the line of code, then the pre-made header area will be there at the top. This area would include such things as the logo, links etc.

I have php on my host server.

Thanks for your help....

The Little Guy
09-05-2006, 03:49 PM
Like this?
<?
include('filename.php');
?>

ts01
09-05-2006, 03:54 PM
thanks, would i just have this code as the first line in my body or would i put this anywhere else to ensure it always stays at the top.

thanks

The Little Guy
09-05-2006, 04:00 PM
just put that where ever you want that file to display.

ts01
09-05-2006, 04:48 PM
great, that seems to work but the only problem i have is my logo... my header.php is in my home folder with and there is a link to my logo image on this page. If i add the header to each page in all the sub directories, the header appears without the logo...is there a way around me having to put a copy of the logo image in each of the folders that i want the header to appear in?

Thanks

The Little Guy
09-05-2006, 04:54 PM
<img alt="Logo" src="/path/to/image.jpg">

using a forward slash at the beginning of the src, will make the browser look in the root directory first and work its way to the file.

ts01
09-05-2006, 05:12 PM
great thanks