hey all im new to the whole php thing, but i got the basic idea down
so yeah i have my site and i want to do a page called releases.php
and in that page i want to have section : trainers, tutorials, misc.
i want the links to be releases.php?trainers, and so forth... i dont know what this is called, that is why i am posting a new topic... if anybody could help me with code that would make me able to do this things it would be greatly appriciated. thanks
stonerifik
i need help with the something.php?something
Moderator: General Moderators
-
stonerifik
- Forum Newbie
- Posts: 23
- Joined: Thu May 22, 2003 7:45 pm
- Location: united states
- Contact:
I am not a PHP guru, but this is the way I ll go about doing this (there could be a better way)
your links should actually be:
and then in your releases.php, you should have something like this:
Hope this helps
Killa Thrilla
your links should actually be:
Code: Select all
releases.php?link=trainersCode: Select all
if (!isset($_GET['link']))
{
//link not specified, display default page
print("html.....");
}
else
{
//variable $link present in URL, retrieve it
$link_to_display = $_GET['link'];
//now according to $link_to_display, chose which html to display
if ($link_to_display == "trainers")
{
//print hmtl for trainers
}
elseif ($link_to_display == "misc")
{
//print html for misc
}
}
?>Killa Thrilla
- metalhardscripts
- Forum Newbie
- Posts: 8
- Joined: Thu May 22, 2003 8:29 pm
- Location: Michigan
- Contact:
this will help you and show you fully how to do this
http://www.everything.32k.org/news.php click link php tutorial on how to do what ya just asked if you need anymore help please email me with any Q at all and i will help ya out

-
stonerifik
- Forum Newbie
- Posts: 23
- Joined: Thu May 22, 2003 7:45 pm
- Location: united states
- Contact:
-
sleepingdanny
- Forum Newbie
- Posts: 12
- Joined: Thu Mar 20, 2003 4:27 am
- Location: Israel
You can just use this:
Code: Select all
<?php
switch($page){
case "trainers":
print "content";
break;
case "tutorials":
print "content";
break;
// and so on...
?>