> make sure you have register_globals on in php.ini or your next question
> will be 'why isn't $compteur set to the value posted?' Better would be to
> change the line to the new magic globals, and learn the right way from
> scratch:
I agree with you as far, as to learn the right way from scratch - but this is
no POST-Var here.
> echo "<input type='radio' name='interet' value='$animalType'";
> if ($_POST['compteur'] == 1) {
> echo "checked";
> }
> echo ">";
This is another bug in the script. Considering that, it would be correctly:
(Note the space between '"' and 'checked')
echo "<input type='radio' name='interet' value='$animalType'";
if ($compteur == 1) {
echo " checked";
}
echo ">";
or shorter:
echo
"<input type='radio' name='interet' value='$animalType'".
($compteur == 1 ? ' checked' : '') . ">";
Regards Sascha
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php