Web Hosting Talk







View Full Version : Help with ...


hare_sa
03-04-2006, 05:44 AM
Hi,

can anybody help with the ...
I want to create web page ( static html ) but an all pages header will be the same ( logo, header picture and menu ). How I can create page so first half of page stays static and the other ( down ) half page gets loaded. So the down half of page will be changing and the up half of page stays there all the time. That will decrease page loading big time, i guess!?

Tnx

Jamie Harrop
03-04-2006, 03:19 PM
The way to do this is by using frames, but frames are a very big no no. See http://www.htmlhelp.com/faq/html/frames.html#frame-problems and http://www.htmlhelp.com/faq/html/frames.html#frame-search for reasons why.

The next best thing are PHP includes. PHP includes allow you to create a file, such as header.php, and then include that file in all your Web pages. This means you can change header.php once and it will update all your Web pages which are including it.

To use PHP includes you will need to change your Web page extensions from .html or .htm to .php

Simply put the code you want to be included in another .php file, save it (lets say header.php is our included file in this example).

Then in each of your Web pages insert the following code where you want header.php to appear:

<?php include($_SERVER['DOCUMENT_ROOT']."/path/to/header.php"); ?>

For more information on PHP includes see http://www.tizag.com/phpT/include.php and http://us2.php.net/include/

h23a1
03-04-2006, 03:51 PM
If you are looking at it from the standpoint of making it easier to develop (not having to see the static portion in every file) than choosing some sort of server side tech would be best. PHP, JSP/Servlets, Perl, etc.

But if you are looking at it purely from a loading perspective, I suppose frames WOULD be faster for subsequent page changes.

kr21
03-04-2006, 04:06 PM
I agree with h23a1 , frames will be a lot faster when loading to a browser, but Jamie covered the most important aspects of why not to use frames.

Its really up to you, but I suggest not using frames.

hare_sa
03-04-2006, 06:42 PM
Hey guys I really apprechiate yours kind explanations and will give try on PHP includes thing.

I go to try now :)

Tnx again

Ackoo-jt
03-04-2006, 06:46 PM
yea, def don't use frames!