NYCPHP Meetup

NYPHP.org

[nycphp-talk] Get the value of a variable regardless of GET or POST

Brian Pang bpang at bpang.com
Fri Sep 12 00:38:03 EDT 2003


$_REQUEST['action']

or, you can turn on register_globals and access it as $action, but I
wouldn't advise it. Using the $_REQUEST array is good.

Be aware of the "security" implications, however, that someone could
override intended $_POST vars by appending to the query string.

Also note that you can dynamically add to the $_REQUEST array, but those
values will not be available in $_POST or $_GET



> Right now I'm using the following code to get the value of $action, since
> I'm either mixing GET/POST within my project OR am not sure about how the
> template will be setup ( yet ).
> 
> $action = (empty($_POST['action'])) ? $_GET['action'] : "";
> 
> Is there another way of acomplishing the same thing?
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> 






More information about the talk mailing list