No-Frames Navigation System
Using PHP

The PHP method is essentially identical to Server Side Includes, except that it doesn't rely on Apache server software. So it can run on Microsoft IIs servers or any server that supports PHP. It's simple to use because you really don't need to know how to program with PHP. All you need to know is the "include()" function, which works exactly like Server Side Includes - only the mark-up is a bit different. The included file is plain old HTML.



Menu

NoFrames Navigation
Main Page


Menu File Examples:

Server Side Includes

External JavaScript

<IFRAME>s

PHP Version

How To Replace Frames
In Your Website

The contents of the menu seen here on the left is actually stored in a separate HTML file. You can update the navigation menu on your whole site, just by editing this single external file. Its even easier than using <IFRAME>s because you don't have to worry about the TARGET attribute, and you can add links to pages outside your own site without having to worry about them loading inside your frameset.

Simply create your HTML pages as usual, but save them on your site with the ".php" filename extension instead of the normal ".html". This will tell the server to process the page as a PHP file and your "include" instruction will be executed before the page is sent to the user as a single, complete HTML document.

<?php include('menu.html'); ?>

That's all. Just change the filename to the one you use for your HTML file that contains the code for your menu and upload it all to your site.

If your site is running on an Apache-based server, you can add the following instruction to your .htaccess file to tell the server to treat all files ending in ".html" as PHP files:

AddType application/x-httpd-php .php .htm .html

This makes it unecessary to rename all of your pages to ".php", which can be time-consuming and cumbersome, as well as temporarily impairing your site's search engine rankings while the changes get indexed.




Copyright © 2005-2017 by Richard L. Trethewey - Rainbo Design Minneapolis. It's not that I think this is such an earth-shatteringly great presentation, but if you want to copy it, I'd appreciate it if you would ask for permission. I've been working with computers for over 30 years now, and one phrase keeps popping into my head - "I hate it when it's right!" And laptops and smartphones are no better.

Looking for more website design information? See my Sitemap!


  Share This Page!  
Still Have Questions? 
Talk To Me! Click Here!