Posted by Michael Fesser on 09/16/07 11:43
..oO(pepper.gabriela@gmail.com)
>Little problem in page A, now:
>
>I imagine I must verify if I have 'something' in $_POST
if (!empty($_POST)) {
...
}
>(I get an Undefined Variable notice when I directly write:
>
> if($_POST[$k]!=''){
> ${$k}=$v;
> }
Even if the form was submitted and $_POST is not empty, you should check
every value if it exists before you use it. You could write a little
function for that.
You could also have a look at the extract() function, if you want to
convert the array into single variables. I don't consider that really
necessary, but anyway.
Micha
[Back to original message]
|