putting pages together.

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
pb2ya
Forum Commoner
Posts: 42
Joined: Sat Jul 06, 2002 5:20 pm
Location: ATL
Contact:

putting pages together.

Post by pb2ya »

ok, all i want to know is how to use the switch statement so that when a certain link is clicked, text is displayed.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

Code: Select all

$pid = $_GETї'pid'];
switch ($pid) {
    case 0:
        print "page id is 0.";
        break;
    case 1:
        print "page id is 1";
        break;
    case 2:
        print "page id is 2";
        break;
    default:
        print "page id is something else";
        break;
}
;-) and try that out with page.php?pid=1
pb2ya
Forum Commoner
Posts: 42
Joined: Sat Jul 06, 2002 5:20 pm
Location: ATL
Contact:

ok ty

Post by pb2ya »

i was doing the same thang b4 without the $_GET. thats y it didnt work.
thanx man 8)
Post Reply