PulsarSL
07-31-2005, 06:30 AM
Here's how I do my navigation.
It's basically a PHP include, but 1 main page with the menu and header graphic, and a content area where each link from the menu opens it's page.
Say this is your code:
<html>
<head><title>My Page</title></head>
<body>
header graphic
menu
links
links
links
extras
content
It's tedious to maintain this as if you want to add a menu selection, you have to update every page!
Here is my way of doing it with PHP.
header graphic
menu
Ok, now where you'd normally put all your links, put this
<?php include("./menu.html"); ?>
Where you'd normally put your content, we'll need some more PHP coding.
<!--Content below-->
<?php
if (isset($_GET["pageID"])) {
include($_GET["pageID"]);
} else {
echo("Sorry, this page doesn't exist!");
}
Now, save this as index.php. Save your menu as menu.html. Save your individual content pages as anything you'd like. Change your menu links to follow the following format:
<a href="index.php?pageID=myContent.html">My Subpage!</a>
Simply replace "myContent.html" with the name of whatever page that link should be calling.
For example.
Index.php psuedo-code
[mandatory html stuff, like head, title, body tags, etc, page header graphic maybe]
[tables for easy formatting]
<?php include("./menu.html"); ?> where your menu would go normally
and finally, the statement above for content where you'd put your content normally.
Hope this made sense and is helpful.
PulsarSL
It's basically a PHP include, but 1 main page with the menu and header graphic, and a content area where each link from the menu opens it's page.
Say this is your code:
<html>
<head><title>My Page</title></head>
<body>
header graphic
menu
links
links
links
extras
content
It's tedious to maintain this as if you want to add a menu selection, you have to update every page!
Here is my way of doing it with PHP.
header graphic
menu
Ok, now where you'd normally put all your links, put this
<?php include("./menu.html"); ?>
Where you'd normally put your content, we'll need some more PHP coding.
<!--Content below-->
<?php
if (isset($_GET["pageID"])) {
include($_GET["pageID"]);
} else {
echo("Sorry, this page doesn't exist!");
}
Now, save this as index.php. Save your menu as menu.html. Save your individual content pages as anything you'd like. Change your menu links to follow the following format:
<a href="index.php?pageID=myContent.html">My Subpage!</a>
Simply replace "myContent.html" with the name of whatever page that link should be calling.
For example.
Index.php psuedo-code
[mandatory html stuff, like head, title, body tags, etc, page header graphic maybe]
[tables for easy formatting]
<?php include("./menu.html"); ?> where your menu would go normally
and finally, the statement above for content where you'd put your content normally.
Hope this made sense and is helpful.
PulsarSL