View Full Version : which one to use and why ?

04-04-2007, 06:38 AM
Hello forums !!
I had some few questions.
Suppose for passing the query string through url and retrieving it , i had seen the 2 ways.
one way:

another way:

$reqVar = '_' . $_SERVER['REQUEST_METHOD'];
$form_vars = $$reqVar;
$parm = $form_vars['parm'] ;

Can anybody make me clear of using second way, actually i didnt get that .
Thanks in advance to all of you.

04-04-2007, 07:20 AM
The second method loads a new array with all of the entries passed to the page in GET, POST and COOKIE fields providing more ways for people to break into your site and change things you don't want changed. You should avoid using $_REQUEST (which is what the first two statements of the second method uses and use specifically $_GET $_POST or $_COOKIE depending on which of the three you expect to contain the value rather than allowing it to be picked up from any of the three (with the potential for it to be overridden in one of the others).