Loading part of the page using PHP<

liunx

Guest
Hi everyone!,

I have a fairly standard HTML website in which the only elements that change when you link from (for example)
index.html to aboutus.html is:
1. the main content
2. the link in the main navigation menu changes color to
indicate they are on that page.

I want the page only to load the code relating to the above so its quicker loading...I noticed PHP pages seem to be much quicker than regular HTML...is it because PHP is capable of doing what I want?!
I have no experience in PHP but think that it is what I require and would appreciate any pointers.
I bought a couple of PHP and MySQL beginner books but don't know where to start!

thanks in advance,

Tonyhere's what I personally do:

make an 'hdr_fns.php' file; inside
I include all my header info, i.e.
the doctype, metatags, CSS, and
all items that will be "global" on my site,
such as the table coding for my header image.

Then I make an 'ftr_fns.php' file;
inside I include the closing tags of any
table, div tags, etc. that I may
have open, as well as close the <BODY> and <HTML> tags.

Then I make pages like:

<?php
require("hdr_fns.php"); // My header
?>

Content here

<?php
require("ftr_fns.php"); // My footer
?>

:D ~ hope this helpsThanks Leonisknovo,

Thats very helpful.

So does this mean that I leave the links as they are to my HTML files and then amend the code in the files themselves to include the PHP for the header and footer code?

Also is this faster loading than having the "global" code in every page?

thanks again!,

Tony
 
Back
Top