Click to See Complete Forum and Search --> : Navigation
The Little Guy
09-22-2005, 08:51 PM
I heard that you can use PHP to make navigation bars, without having to change each file every time that you add something to the navigation bar.
How do I do this, if it is possible?
Sheldon
09-22-2005, 09:21 PM
make your navigation menu/bar just like normal, save it in its own file for this instance we will call is nav.php.
Then in each page place this code exactly where you want the navigation menu to be.
<?php
//include the navigation menu.
include('path/to/nav.php');
?>
Make sur ethe path is correct or if it is in the same folder just have the name of the file there.
Let me know how that goes
Sheldon
09-22-2005, 09:22 PM
Oh i forgot to say, all of your pages that will include the nav.php must now have the extension .php so you may have to change the links in your like to match, else there is a way in i think either your php.ini file or your httpd.conf file to pharse .html files as .php
SpectreReturns
09-22-2005, 10:20 PM
Or you can make your webserver parse .html files.
Sheldon
09-23-2005, 12:58 AM
Or you can make your webserver parse .html files.
Yes thats what i said in the post above.
The Little Guy
09-23-2005, 10:07 AM
cool thanks, Im glad I didn't start to make the files yet :)
Sheldon
09-23-2005, 05:45 PM
remember no to write the
<html>
<head>
<title></title>
<meta's>
</head>
<body>
in every page, just the page that for instance is your header file, that way you can edit it once and include that in each page too.
Refer to this thread (http://www.webdeveloper.com/forum/showthread.php?t=79373) for more ideas!
Sheldon
09-23-2005, 05:47 PM
http://www.speedsurf.to/akick/akick.html
http://www.speedsurf.to/rbg/rbg.html
Neither links on your sig works? Is it just me but i got a page not found?
The Little Guy
09-27-2005, 09:07 AM
Neither links on your sig works? Is it just me but i got a page not found?
Yeah that is becuase someone didn't follow the rules, and everyones pages got deleted, and I havn't started over since then.