My first question, if not appropriate, please ignore.
I have a drop down coded in php which is used to select a value. The value set is 'Off', 0, 1, 2, ... 179 (i.e. 181 values in total).
In the beginning, the drop down shows all 181 values correctly.
After the value is selected from drop down, some other button is pressed to call a mysql procedure. On call completion, page is refreshed.
The drop down is supposed to retain the selected value across page refreshes, which it does. User should be allowed to change the values though.
However, after the first page refresh, If I try to select a different value from the drop down, All I see in there is the previously selected value 181 times.
Below is the code, could someone please help fix it.
I am not a php programmer, just trying to fix a glitch that my resource left in there.
<select style="width: 87px; height:35px;color:#113C83;margin-bottom:0;border-right-width:0;" id="angle1">
<option value="Off">Off</option>
<?php
for($i=0;$i<=179;$i++)
{
if(isset($_SESSION['angle1']))
{
?>
<option value="<?php echo $_SESSION['angle1']; ?>" selected><?php echo $_SESSION['angle1']; ?></option>
<?php
}
else
{ ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php
}
} ?>
</select>