Afficher un message
Vieux 16/09/2007, 13h43   #13
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: no empty form fields after submitting form

..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
  Réponse avec citation
 
Page generated in 0,04807 seconds with 9 queries