DanWilliamson
12-01-2006, 08:49 PM
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
<?php
?>
Then we add our switch variable which is pretty much self-explanitory.
switch($id) {
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.
default:
include('url.php');
Now obviously you change the URL in the link too the URL you want it too display.
Now for the ID of the page.
break; case "The Page ID":
I'm guessing that this has already been explaned, you just change the ID of the pages.
Now too actually include the pages.
include('page1.html');
Now the code all together.
<?php
switch($id) {
default:
include('url.php');
break; case "The Page ID":
include('The ID.php');
}
?>
Now your links are going too have that cool look that all the big sites have :P
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
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
<?php
?>
Then we add our switch variable which is pretty much self-explanitory.
switch($id) {
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.
default:
include('url.php');
Now obviously you change the URL in the link too the URL you want it too display.
Now for the ID of the page.
break; case "The Page ID":
I'm guessing that this has already been explaned, you just change the ID of the pages.
Now too actually include the pages.
include('page1.html');
Now the code all together.
<?php
switch($id) {
default:
include('url.php');
break; case "The Page ID":
include('The ID.php');
}
?>
Now your links are going too have that cool look that all the big sites have :P
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