Help
i have no idea whats going on with this stoooopid thing! i am soo frustrated!
i have gender radio buttons which look like this
<label for="gender">Gender:</label>
<input type="radio" name="gender" value="male" <?=($gender == 'male' ? 'checked' : ''); ?> >male
<input type="radio" name="gender" value="female" <?=($gender == 'female' ? 'checked' : ''); ?> >female
<font size="2" color="red"><?php print "$gendermessage" ?></font><p>
i then have a little validation code above the html which goes like this
if (empty($POST['gender']) || ($POST['gender'] != "male" && $_POST['gender'] != "female"))
{
$gendermessage = "Please enter a gender ";
$errors ++;
the problem is when i click female and print $gender after submit it prints female even if i pressed male.
when i click submit and the page is caught by another field the radio button does not stay empty or at the box which was previously chosen it snaps to female!
consequently i cannot distinguish between male and female which means none of my application works 🙁
i'm totally baffled- i know i've been asking alot but does anyone know why this is happening?
in much desperation
VERYnoobyphpchick😉