What command will put a list of the CGI parameters passed from a HTML form along with there associated values into an array called $cgi_vars?
$cgi_vars = $_REQUEST;
$cgi_vars = $_CGI_VARIABLE;
$cgi_vars = get_env($HTTP_SERVER_VARS);
$cgi_vars = print_r($HTTP_SERVER_VARS);
There's $_GET
and $_POST
, depending on what method you're using to submit the form. $_REQUEST
works as well, but should be avoided because what you get out of it depends on PHP settings, and a mixed-mode submission (e.g.a POST form but using query variables in the URL) is dependent on those settings.
So you'd have
$get_vars = $_GET;
$post_vars = $_POST;
but there's no reason to do this - the $_GET/POST arrays are superglobals and available anywhere in PHP. Your new variables are just normal variables and subject to the PHP scoping rules.
$_POST
contains POST data and $_GET
contains data from the query string