PDA

View Full Version : Html header & footer



Lil_Kins0
Mar 5th, 2012, 01:00 AM
Hi guys, please i need help here.
Am kinda a newbie in web designing. I recently decided to create a website for my personal use, which would enable me develop my skill. Now my request is this; "is it possible to create a header and a footer?" I know its possible with <table> element, but i dont wana style it with table. I made some search and found out that its possible with php or ruby, but am not that good in those languages. I wana know if its possible to do it with just html or maybe html+css. Thanks in advance.

dan-dan
Mar 5th, 2012, 01:13 AM
How is it possible using tables?

Either way, I think it would be pretty simple to add include 'header.php'; to a PHP file. All you need to do is change the file extension from HTML to PHP and add some <?php ?> tags for your PHP.

dan-dan
Mar 5th, 2012, 01:22 AM
To add:
You don't really need to know PHP to use HTML based PHP files.

Simply write the HTML and use the PHP file extension :)

Lil_Kins0
Mar 5th, 2012, 01:34 AM
Thanks. Buh i didnt get the include header.php aspect

dan-dan
Mar 5th, 2012, 01:50 AM
Thanks. Buh i didnt get the include header.php aspect

Sorry, I really wasn't that clear.

You can't do this with HTML alone, you need to use a server side language like PHP.

Creater your header/footer in normal HTML, then save it as eg: header.php.

Now in your index page you should name it index.php then at the top of the page write
<?php include 'header.php'; ?>

Do the same for the footer. Anything in between can be written as normal HTML.

Most importantly, you need your PHP to be interpreted. Is your site hosted locally?

Lil_Kins0
Mar 5th, 2012, 01:57 AM
Thanks. Lemme try it now

Lil_Kins0
Mar 5th, 2012, 02:04 AM
Thanks alot. Worked perfectly.