Thread: $_get
View Single Post
Old 02-04-2008, 09:42 PM   #1 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default $_get

Hi!

My question is a fairly simple question, but when I thought about it, I really had no clue..

So basicly.
I have a member.php script.

If I write member.php?u=4, it would generate and echo out a member profile of the user with user_id = 4.

However, if I write member.php?g=admins, it would generate and echo out a list of all the members that are currently in the group "admins"(with the field rank, set to 3).

And if I write member.php?show=all, it would generate a list of all the members.

So my question is as following.

How do I prevent users from writing member.php?u=4&show=all&g=mods ????

How can I force them just to have one, and if they write all of them, show some kind of error message, or perhaps redirect to the list of all as a default "member.php" -page ??

PHP Code:
if(count($_GET) > 1) {
echo 
'Na na na!';
}

else {
$group $_GET['g'];
$user $_GET['u'];
$default $_GET['show'];
}
// etc.. 
Possible? Wrong method? Better method?

Thanks in advance!
__________________
Tanax is offline  
Reply With Quote