View Single Post
Old 09-18-2005, 07:19 PM   #3 (permalink)
jaswinder_rana
The Acquainted
 
Join Date: May 2005
Posts: 106
Thanks: 0
jaswinder_rana is on a distinguished road
Default

still if there are 2 or more choices to be made i always prefer switch
PHP Code:
$page = (isset($_REQUEST['page']))?$_REQUEST['page']:'';
switch(
$page)
{
 case 
'x':
    
//do this
   
break;
 case 
'xy':
   
//do this
  
break;
 default:
  
//do this
  
break;

this is easier to handle than if. i do not know how much execution time difference is in if and switch, however.
and also i prefer to be precise,, user $_GET for querystrings and user $_POST for post

i know $_REQUEST provides a wider range for script, as both methods can be used to do same thing, but, in that case post data can always be overridden by get data, unless get comes first and then post (which i presume is default). i also think cookies are included in $_REQUEST (no t sure), and if they are then again its the same problem

hope this helps
__________________
---------------------------
Errors = Improved Programming.
Portfolio
Send a message via MSN to jaswinder_rana
jaswinder_rana is offline  
Reply With Quote