Welcome and have a nice stay !       login   register   need help?  

 Page Info

Page Title: PHP Navigation
Description: This tutorial explains how to get your pages looking like this: index.php?id=page
Author: Slaker
Submission Date: 28-05-2005 16:06

 Rating & Comments

View or add comments: (1)
Average members rating: 5.00



Okay, this code is similar to Iframes and Includes in a way, and is useful for sites with many pages. Basically what it does, is when you click a link, it appears like this:

http://www.yoursite.com/index.php?id=page.

Here is the code for it:

Code :
// hide source code
// hide line numbers

 1  
 2  <?php
 3  
switch($id) {
 4  default:
 5  include(
'index.php');
 6  break; case 
"art":
 7  include(
'art.php');
 8  break; case 
"graphics":
 9  include(
'graphics.php');
10  break; case 
"services":
11  include(
'services.php');
12  break; case 
"forum":
13  include(
'forum.php');
14  break; case 
"downloads":
15  include(
'downloads.php');
16  }
17  
?>
18  




Now, here is the part where it comes to customization. First, insert this code into your page where ever you want your content to come up. Next, say you dont want it to come up index.php?id=page, but instead you want index.php?tutorial=page or something. Well just change the second line of the code from $id to $tutorial or whatever you want it to appear as.

Next, the part that says "break; case "name":" change the "name" to what ever the name of the page is, and below that change the URL to the page you wish the name to correspond to. To add more breaks, just copy paste a selection of the code and put it below.

Finally, linking the page. Say you have some text you would like to link to a page using this system. The URL you would use would be: index.php?id=page. Its pretty simple.

If you have questions, please ask me.

Slaker.

Donation:

If you like our free quality work, make a donation by using Paypal and tell us what you would like to see improved on our site for the next few months.

Comments


Archie  Comment #2100 posted on 04-08-2006 17:49

For anyone that wants they can get a full working one here free.

http://sts.webguy.ca/?page=STSDownload look for v1.0


Cheers


 Site Activity
Currently online: 0 member(s), 43 guest(s) : All members offline.


 Quick Menu
sitemap
search
galleries
main
forums


 Our Services

Main Projects
Designers For Hire
Unique LDU Skins
LDU Skins For Sale
Seditio Skins For Sale
Templates For Sale


 Statistics
18582 registered members,
1870 topics in forums,
21584 posts in forums,
13589667 pages served since 2004-05-09.
more


 7th Version Design

+++
top