Step 1
The main code:
Step 2
So first of all lets break the code down.
<?php
switch ($HTTP_GET_VARS[id]) {
First off <?php is required to notify that you want php coding to start.
Second of all $HTTP_GET_VARS [id] is telling the document to get the variable "id" you can change "id" to what ever you want. But what ever you change it to must be changed after index.php? So for instanced what we have above, would make the address look like this http://blahblah.com/index.php?id
Now you are defining the default document that is to be loaded if no ?id is specified. So type in include" "; your default doc such as a news page. Make sure you have break; on its own line, and make sure that it is in there after each case.
Next what we have is a case it is basically the same thing as the default case but you are defining what to do if the web address is blahblha.com/index.php?id=fonts . What it is saying is if "Fonts" is existant after ?id= then include 'fonts.php'; so what you want to do is replace fonts.php and change the case to what ever you want.
}
?>
Step 3
Put the entire php code where you want each page to load, keep in mind that each page will load at the same place no matter what, and backgrounds are not included either.
Step 4
The final step is to link text or buttons or what ever to each switch.. You do this by adding an <a href="index.php?id=fonts">Some Text</a> to your site or navigation.
Now when ever someone clicks that link "Some Text" it will goto the case "fonts" look to see what action it is told to do.. since it is include the page fonts.php it will include fonts.php where ever you place the php code at.
Continue to link each ahref to each case changing the id name (?id=fonts) make sure you do not specify a target or it will popup in a new window.
Note: Make sure to save the page that has the php code in it as a .php or .php3 file, if you don't it will not work and your navigation code will go kabloome.
The main code:
| Code: |
| <?php
switch ($HTTP_GET_VARS[id]) { //Default - case default: include "news/news.php"; break; //Fonts - case case 'resources=fonts': include 'resources/fonts.php'; break; //Scripts - case case 'resources=scripts': include 'resources/scripts.php'; break; } ?> |
Step 2
So first of all lets break the code down.
<?php
switch ($HTTP_GET_VARS[id]) {
First off <?php is required to notify that you want php coding to start.
Second of all $HTTP_GET_VARS [id] is telling the document to get the variable "id" you can change "id" to what ever you want. But what ever you change it to must be changed after index.php? So for instanced what we have above, would make the address look like this http://blahblah.com/index.php?id
| Code: |
| //Default - case
default: include "main.php"; break; |
Now you are defining the default document that is to be loaded if no ?id is specified. So type in include" "; your default doc such as a news page. Make sure you have break; on its own line, and make sure that it is in there after each case.
| Code: |
| //Fonts - case
case 'fonts': include 'fonts.php'; break; |
Next what we have is a case it is basically the same thing as the default case but you are defining what to do if the web address is blahblha.com/index.php?id=fonts . What it is saying is if "Fonts" is existant after ?id= then include 'fonts.php'; so what you want to do is replace fonts.php and change the case to what ever you want.
}
?>
Step 3
Put the entire php code where you want each page to load, keep in mind that each page will load at the same place no matter what, and backgrounds are not included either.
Step 4
The final step is to link text or buttons or what ever to each switch.. You do this by adding an <a href="index.php?id=fonts">Some Text</a> to your site or navigation.
Now when ever someone clicks that link "Some Text" it will goto the case "fonts" look to see what action it is told to do.. since it is include the page fonts.php it will include fonts.php where ever you place the php code at.
Continue to link each ahref to each case changing the id name (?id=fonts) make sure you do not specify a target or it will popup in a new window.
Note: Make sure to save the page that has the php code in it as a .php or .php3 file, if you don't it will not work and your navigation code will go kabloome.
