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:
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.
http://www.yoursite.com/index.php?id=page.
Here is the code for it:
Code :
// hide source code
// hide line numbers
// 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. |
|
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


























