| 
 Posted by PleegWat on 10/22/06 16:29 
In article <453b9820$0$9457$ba620dc5@text.nova.planet.nl>, wouter  
says... 
> hey hi..... 
>  
> I wanna make a switch wich does this: 
>  
> if pagid is set do A, 
> if catid is set do B, 
> if projectid is set do C, 
> else do D. 
>  
> So i was thinking something like this: 
>  
> switch() 
> { 
> case isset ($_GET['pagid']):			 
> 	{ 
> 	echo "pagid= set"; 
> 	} 
> 	break; 
> case isset ($_GET['catid']): 
> 	{ 
> 	echo "catid= set"; 
> 	} 
> 	break; 
> case isset ($_GET['projectid']): 
> 	{ 
> 	echo "projectid= set"; 
> 	} 
> 	break; 
> default: 
> 	{ 
> 	echo "nothing set"; 
> 	} 
> } 
>  
>  
> wich works great in my mind but not on my server.... 
>  
> Anybody here know how to do this in a way wich does work?? 
>  
 
You don't need a switch here, but a if...elseif...else structure: 
 
if( isset($_GET['pagid']) ) 
{ 
	echo "pagid= set"; 
} 
elseif( isset($_GET['catid']) ) 
{ 
	echo "catid= set"; 
} 
elseif( isset($_GET['projectid']) ) 
{ 
	echo "projectid= set"; 
} 
else 
{ 
	echo "nothing set"; 
} 
 
--  
PleegWat 
Remove caps to reply
 
[Back to original message] 
 |