PHP Tutorials [Easy PHP Nav,the i-frame of the future or something]
OK after many email request I finally got this up,its the way I have my navigation, and this isn't really know PHP its just a code ONE CODE now I learned how to do my nav from a tutorial omegabum.com made, so now I'm writing this one an maybe just MAYBE you can get this the first time
OK first I'm going to show you the code,ready?
------------
<?php
switch($id) {
default:
include('main.htm');
break; case "blah":
include('blah1.htm');
break; case "blah2":
include(blah2.htm');
break; case "blah3":
include('blah3.htm');
break; case "blah4":
include('blah4.htm');
break; case "blah5":
include('blah5.htm');
}
?>
----------------------
-DEMO-
Now that seems easy right? Well it is but before we go any further MAKE SURE
YOUR HOST SUPPORTS PHP ,if it doesn't well close this page now or find a
host that does...
The Steps:
------------
- The first thing you need to do is copy this file
for the php coding (don't copy that coding above).
- Now if your confused maybe about the coding itself let me break it down
----------
<?php
switch($id) {
default:
include('main.htm'); ---put the url for ur newspro or something
break; case "blah": ----put the name u want the
page to be an same for the rest
include('blah1.htm'); ----put the url for another page an
same for the rest
break; case "blah2":
include(blah2.htm');
break; case "blah3":
include('blah3.htm');
break; case "blah4":
include('blah4.htm');
break; case "blah5":
include('blah5.htm');
}
?>
----------
Now you can of course make this longer by just adding this at the end an for
common sense sake put it after:
-------------------
break; case "blah5":
include('blah5.htm');
---------------------
and for common sense sake put it above:
-----
}
?>
----
- OK now that u have the code u need to insert it where u would put your
news or like if u had an i-frame replace the i-frame code the the php coding
,then save the page an name it yourpage.php
- Got that?..ok now for your links put this as the link "?id=default"
now the name must correspond with your coding
ex: if
--------------------
break; case "blah":
include('blah1.htm');
--------------------
for the link it would be <a href="?id=blah">blah</a>
and it would take u to the blah1.htm page.
- Now you just need to upload yourpage.phpan it DOESN'Thave
to be upload in ASCII, but it doesn't matter.
- OK now that's basically it ,an really all I can explain BUT I wont leave
you it the cold so just d/l the example here
If you find this information inaccurate or have questions post in the forums