Reply to Re: parse empty checkbox to php

Your name:

Reply:


Posted by thomasriise on 09/07/07 13:05

When I have this code you postet, nothing happens:

--
<?php

echo '<html><head><title>checkbox tester</title></head>';

if ($submit){
foreach($_POST['fruitkeys'] as $fruit){
echo isset($_POST['fruit'][$fruit]) ? "you choose
$fruit<br>" : "you did NOT choose $fruit<br>";
}
}

echo '
Choose a fruit:<br><br>
<input type="hidden" name="fruitkeys[]" value="apples"><input
type="checkbox" name="fruit[apples]" value="apples">apples<br>
<input type="hidden" name="fruitkeys[]" value="oranges"><input
type="checkbox" name="fruit[oranges]" value="oranges">oranges <br>
<input type="hidden" name="fruitkeys[]" value="peaches"><input
type="checkbox" name="fruit[peaches]" value="peaches">peaches <br>
<input type="hidden" name="fruitkeys[]" value="mangos"><input
type="checkbox" name="fruit[mangos]" value="mangos">mangos<br>
<input type="submit" name="submit" value="submit">
';

echo '</form></body><html>';

?>
--

What am I doing wrong?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация