I have the following PHP code:
<?php
echo '<select name="transact_day" id="transact_day">';
echo"<option value=''>Select Day</option>";
for($i= 1; $i<=31; $i++){
echo "<option value=". $i ." ";
if(isset($day) == "$i"){
echo 'selected = "selected" ';
}
echo ">$i</option>
";
}
echo '</select>';
?>
I want it to be sticky but when a date is selected (e.g 10) and the form is submitted it's only the value 31 that is sticky (irrespective of the selected date). I have tried different options, searched through similar questions but I couldn't figure out what was wrong with the above code. Any suggestion? Thank