| Site Map | WizTools.org | jCraze Blog |
![]() |
Dynamic Navigation Bar & Footer Using PHPHow about a navigation bar and a footer which is dynamically included in all the pages in your site? Suppose if you want to add new content to the navigation bar or change some information in the footer, just edit these files and upload it. And voila! All the 200 pages in your site is automatically updated! You need to create the navigation file and the footer file separately. The files can have HTML tags inside them. But they should not be a self-contained HTML file having the <html> <head> & <body> tags. Also note that these files can have PHP instructions within valid PHP tags. These instructions will be processed by the PHP engine even though they have different extension. Suppose you have your footer file named "footer.dat", you can dynamically call this file in another PHP file thus: <? Note 1: If the footer file is located in some other directory, you may use the "../" and "directoryname/" conventions too. Instead of using the relative file path, the absolute path of the file on the server can also be used. But the "include" statement cannot be used to display files stored in external server. Using the "include" statement you can create a template for your site, and manage your site more efficiently, as I do! Note 2: If you want to display files residing in another server, you can use the PHP function readfile(). Usage:
<?php - Subhash |
Sign Guestbook
|
Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.