Click here to Skip to main content
15,893,337 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
XML
<tr>    <!--date-->
    <td><br>Date:</br><Select name="day">
    <!--value-->
    <option value="select"></option>
    <?php
        for($day = 1 ; $day >= 30; $day++){
            echo "<option value=".$day.">".$day."</option>";
        }
    ?>

    </Select></td>
</tr>
Posted
Comments
Sergey Alexandrovich Kryukov 29-Aug-14 13:46pm    
Did you try to use the debugger?
—SA

1 solution

try changing from
PHP
<tr>    <!--date-->
    <td><br>Date:</br><Select name="day">
    <!--value-->
    <option value="select"></option>
            for($day = 1 ; $day >= 30; $day++){
            echo "<option value=".$day.">".$day."</option>";
        }
    ?>
</td></tr>


to
PHP
<tr>    <!--date-->
    <td><br>Date:</br><Select name="day">
    <!--value-->
    <option value="select"></option>
            for($day = 1 ; $day <= 30; $day++){
            echo "<option value=".$day.">".$day."</option>";
        }
    ?>
</td></tr>
 
Share this answer
 
Comments
JaironLanda 29-Aug-14 10:53am    
what is the problem?
ChauhanAjay 29-Aug-14 10:55am    
for($day = 1 ; $day >= 30; $day++) this line is the problem. the condition part in your for loop is wrong. the condition will never be satisfied so it wont go inside.
JaironLanda 29-Aug-14 10:59am    
thanksss
ChauhanAjay 29-Aug-14 11:01am    
can you please mark as solved
Sergey Alexandrovich Kryukov 29-Aug-14 13:47pm    
Sure, a 5; OP is recommended to accept it formally. (And I would recommend to use the debugger. :-)
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900