Posted by Rik Wasmus on 09/07/07 13:22
On Fri, 07 Sep 2007 15:05:16 +0200, thomasriise <thomasriise@gmail.com> =
=
wrote:
> When I have this code you postet, nothing happens:
>
> --
> <?php
>
> echo '<html><head><title>checkbox tester</title></head>';
>
> if ($submit){
if(isset($_POST['submit'])){
check why register_globals should be off.
> foreach($_POST['fruitkeys'] as $fruit){
> echo isset($_POST['fruit'][$fruit]) ? "you choose
> $fruit<br>" : "you did NOT choose $fruit<br>";
> }
> }
Starting form tag?
> echo '
> Choose a fruit:<br><br>
> <input type=3D"hidden" name=3D"fruitkeys[]" value=3D"apples"><input
> type=3D"checkbox" name=3D"fruit[apples]" value=3D"apples">apples<br>
> <input type=3D"hidden" name=3D"fruitkeys[]" value=3D"oranges"><input
> type=3D"checkbox" name=3D"fruit[oranges]" value=3D"oranges">oranges <b=
r>
> <input type=3D"hidden" name=3D"fruitkeys[]" value=3D"peaches"><input
> type=3D"checkbox" name=3D"fruit[peaches]" value=3D"peaches">peaches <b=
r>
> <input type=3D"hidden" name=3D"fruitkeys[]" value=3D"mangos"><input
> type=3D"checkbox" name=3D"fruit[mangos]" value=3D"mangos">mangos<br>
> <input type=3D"submit" name=3D"submit" value=3D"submit">
> ';
>
> echo '</form></body><html>';
>
> ?>
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|