i need help with the something.php?something

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stonerifik
Forum Newbie
Posts: 23
Joined: Thu May 22, 2003 7:45 pm
Location: united states
Contact:

i need help with the something.php?something

Post by stonerifik »

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
User avatar
Eugene
Forum Newbie
Posts: 24
Joined: Tue Jun 18, 2002 12:40 pm
Location: Montreal

Post by Eugene »

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:

Code: Select all

releases.php?link=trainers
and then in your releases.php, you should have something like this:

Code: 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
}

}
?>
Hope this helps

Killa Thrilla
User avatar
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

Post by metalhardscripts »

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 :) 8)
stonerifik
Forum Newbie
Posts: 23
Joined: Thu May 22, 2003 7:45 pm
Location: united states
Contact:

Post by stonerifik »

hmmm ok thank you both, ill make sure to try this out when i get home :)
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

well it's a good thing i searched for this topic, or i would have asked the same question ;)
sleepingdanny
Forum Newbie
Posts: 12
Joined: Thu Mar 20, 2003 4:27 am
Location: Israel

Post by sleepingdanny »

You can just use this:
:P

Code: Select all

<?php
switch($page){
case "trainers":
print "content";
break;

case "tutorials":
print "content";
break;

// and so on...
?>
Post Reply