I have a code as below
foreach($_POST as $varname => $value)
{ $list[$varname] = $value; }
[/COLOR]
But when I execute it I get the following error
Invalid argument supplied for foreach() in ...... I also have tried $HTTP_POST_VARS instead $_POST
if (!empty($_POST)) { foreach ($_POST as $varname => $value) { $list[$varname] = $value; } }
though why not use $POST directly instead of using some $list array? Conversely, $list = $POST; might also work, though again would be redundant.