Hey,
I've written a tutorial on a basic navigation in PHP which could be useful.
Well first before we even begin trying, make sure your host is PHP supported, so don't try this with Freewebs.
Also don't forget to save the index as .php
First we open the PHP tag
Then we add our switch variable which is pretty much self-explanitory.PHP Code:<?php
?>
Now if your new too PHP you can always tell a variable by the American Dollar sign $ Now we're ready too make the actually links.PHP Code:switch($id) {
Now obviously you change the URL in the link too the URL you want it too display.PHP Code:default:
include('url.php');
Now for the ID of the page.
I'm guessing that this has already been explaned, you just change the ID of the pages.PHP Code:break; case "The Page ID":
Now too actually include the pages.
Now the code all together.PHP Code:include('page1.html');
Now your links are going too have that cool look that all the big sites havePHP Code:<?php
switch($id) {
default:
include('url.php');
break; case "The Page ID":
include('The ID.php');
}
?>
page.php?id=ID
Hope this helps, now for advanced PHP coders there are more and better ways too do this, but this is a very simple yet effective way.
- Dan






Reply With Quote
+Rep

