Thursday, April 19, 2012

$_GET with Switch Statement

i have alot of get values that define the page the user gonna see , for example for "profile" i will show the profile page and so on..



to find out what page to display i tried to do something like that:



switch ($_GET) {
case 'profile':
require_once('function/profile.php');
break;
case 'team':
require_once('function/team.php');
break;


but it shows no result..



i send the GET request like that : index.php?profile , for example..



what is the problem here and how can i can manage to do something similar that work as well. thank you in advance!





No comments:

Post a Comment