Re: form question
| From: | Monte Ohrt | Date: | Wed, 19 Jul 2000 13:51:23 +0000 |
| Subject: | Re: form question | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7265@lists.php.net to get a copy of this message | ||
None of your checkboxes have a value attribute.
"Martin A. Marques" wrote:
>
> On Wed, 19 Jul 2000, Monte Ohrt wrote:
> > It should be an array of values. On the form the html should look like:
> >
> > <input type="checkbox" name=fila_art[] value="value1">
> > <input type="checkbox" name=fila_art[] value="value2">
> > <input type="checkbox" name=fila_art[] value="value3">
> >
> >
> > Then once the form is submitted, the values should be accessible
> > with $fila_art[0], $fila_art[1], etc... be careful about
> > variable scope, $fila_art will be undefined within a function
> > if it isn't passed or made global.
>
> Actually my "test" form looks like this:
>
> <form action="prueba-resultado.php" method="post">
> <input type="checkbox" checked name=ar_pru[]><BR>
> <input type="checkbox" checked name=ar_pru[]><BR>
> <input type="checkbox" checked name=ar_pru[]><BR>
> <input type="submit" value="Go!">
> </form>
>
> and prueba-resultado.php has this:
>
> <html>
> <body>
> <?
> for(reset($ar_pru);$llave=key($ar_pru);next($ar_pru)){
> echo(sprintf("La variable es %s, y su valor %s \n <br> \n",$llave,
> $ar_pru[$llave]));
> }
> ?>
> </body>
> </html>
>
> The output that I get in my navigator is this:
>
> <html>
> <body>
> </body>
> </html>
>
> Any ideas???
>
> Thanks!
>
> --
> "And I'm happy, because you make me feel good, about me." - Melvin Udall
> -----------------------------------------------------------------
> Martín Marqués email: martin@math.unl.edu.ar
> Santa Fe - Argentina http://math.unl.edu.ar/~martin/
> Administrador de sistemas en math.unl.edu.ar
> -----------------------------------------------------------------
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/