Re: Problem with $_POST variable




Michal Wozniak wrote:
> > <?php
> > var_dump($_POST);
>
> Well, if you DUMP the $_POST var here...
>
> > $user=$_POST['login'];
> > $password=$_POST['password'];
>
> ... then obviously you won't get anything here. $_POST is dumped, so
> there is no such thing as $_POST[whatever]. Don't dump. :)


This is absolutely false.

The "dump" in var_dump should be thought of as "dumping output to
screen". It is analagous to print or echo. It does not unset the
variable, or change it in any way.

It is very useful to use var_dump in the way the original poster used
it, because "print" would not work ( $_POST is an array ) and "print_r"
would produce incomplete results ( because $_POST might contain nested
arrays ). var_dump will echo all the contents of $_POST which is
useful for testing purposes.

.