Hi all,
The issue is i am selecting option 1 and then going to the next page and i am coming back.The option MALE is being saved.When i try to echo it,nothing is showing up.
<tr>
<td class="tdvisitbig">
<select class="selectbig" name="gender">
<?
$arr = array("1"=>"MALE", "2"=>"FEMALE");
foreach($arr as $p=>$v)
{
if($p != $gender)
{
echo "<option value='$p'>$v</option>";
}
else
{
echo "<option selected value='$p'>$v</option>";
}
}
?>
</select>
</td>
</tr>
The code which i am using to echo it is
if($gender == '1'){echo "male";}
if($gender == '2'){echo "female";}
Is there something i am missing .when i am selecting option 2 and save it and then try to echo it it prints out fine.
Thanks in advance.
The issue is i am selecting option 1 and then going to the next page and i am coming back.The option MALE is being saved.When i try to echo it,nothing is showing up.
<tr>
<td class="tdvisitbig">
<select class="selectbig" name="gender">
<?
$arr = array("1"=>"MALE", "2"=>"FEMALE");
foreach($arr as $p=>$v)
{
if($p != $gender)
{
echo "<option value='$p'>$v</option>";
}
else
{
echo "<option selected value='$p'>$v</option>";
}
}
?>
</select>
</td>
</tr>
The code which i am using to echo it is
if($gender == '1'){echo "male";}
if($gender == '2'){echo "female";}
Is there something i am missing .when i am selecting option 2 and save it and then try to echo it it prints out fine.
Thanks in advance.