mercredi 13 juillet 2022

How to display more then one month result?

I want to display several months at once. Currently showing only one month. When I try to select multiple months, it only shows one. What could be wrong with my code? Thank you very much for the reply.

Here is my code:

for($i=1;$i<=30;$i++){
    $place_of_counselling=get_field('noustamise_koht'.$i.'',$post->ID);
    $date=date_create(get_field('noustamise_kuupaev'.$i.'',$post->ID));
    if(date('m')!= date_format($date,"m") && !isset($_POST['month'])){
        continue;
    }elseif($_POST['month'] != date_format($date,"m")){   
        continue;
    }

and the form code:

<form action="" method="post">
                        <input type="checkbox" id="01" name="month" value="01">
                        <label for="01">Jaanuar</label><br>
                        <input type="checkbox" id="02" name="month" value="02">
                        <label for="02">Veebruar</label><br>
                        <input type="checkbox" id="03" name="month" value="03">
                        <label for="03">Märts</label><br>
                        <input type="checkbox" id="04" name="month" value="04">
                        <label for="04">Aprill</label><br>
                        <input type="checkbox" id="05" name="month" value="05">
                        <label for="05">Mai</label><br>
                        <input type="checkbox" id="06" name="month" value="06">
                        <label for="06">Juuni</label><br>
                        <input type="checkbox" id="07" name="month" value="07">
                        <label for="07">Juuli</label><br>
                        <input type="checkbox" id="08" name="month" value="08">
                        <label for="08">August</label><br>
                        <input type="checkbox" id="09" name="month" value="09">
                        <label for="09">September</label><br>
                        <input type="checkbox" id="10" name="month" value="10">
                        <label for="10">Oktoober</label><br>
                        <input type="checkbox" id="11" name="month" value="11">
                        <label for="11">November</label><br>
                        <input type="checkbox" id="12" name="month" value="12">
                        <label for="12">Detsember</label><br>
                    
                        <input type="submit" value="Otsi" name="submitbutton" >
                </form>



Aucun commentaire:

Enregistrer un commentaire