Posts: 253
Location: Calgary, Alberta, Canada
|
When it comes down to this, there are a lot of different ways of doing it, and its all in a users preference. Some may be better, some may be worse, but here's how I do it:
This is the code for your links:
HTML Code:
<a href="index.php?ID=NAME1">Link for Name1.php</a>
<a href="index.php?ID=NAME2">Link for Name2.php</a>
Obviously, you can change "ID" to whatever you want (keeping in mind it will need to be changed in the below code), and NAME1 should be the filename of the page you want, not including the extension. (about.php would be "about").
Here's the PHP code to display the content:
PHP Code:
<?php if(isset($id)){ // Obviously, if you used something instead of "id" include("$id.php"); // up above, you'd change the "id" here to the same thing. } else{ include("home.php"); // This is the page to include if no links have been selected. } ?>
I hope you understand my method. You don't need to use it, but hopefully it is clear, and not confusing. This is the way I was taught, and I have always used it.
__________________
Signature Coming Soon! :) Please login or register to view this content. Registration is FREE
|