dimanche 29 mars 2020

What is the error in a below written php source code for drop down list of date of birth?

I am trying create login web page.This is the code written to display drop down list for date of birth.But I am not getting day and year in the drop down list.If i write all the 31 days then I will get days.But it is not working for for loop in php. Please guide me in this.

 <select class="biginput" name ="day">
    <option> Day </option>
    <?php for($i=1;$i<=31;$i++)
          {
              echo "<option value=$i>$i</option>";
          }
    ?>
</select>
<select class="biginput" name="year">
    <option>Year</option>
    <?php for($i=date("Y");$i>=date("Y")-90;$i--)
              echo"<option value=$i>$i</option>";
    ?>
</select>

Output: I am getting only blank list instead of days and year. Output




Aucun commentaire:

Enregistrer un commentaire