Hi all, i would like to ask about, i have (date_from) and (date_to), and i want the range of the date show in the checkbox.
Example: date from: 6/8/2014 and date to: 8/8/2014.
it will show 6/8/2014, 7/8/2014 and 8/8/2014 along with check box.

so, i have success make the date and checkbox show with the code below;

However, i wish to know how to get the value from the check box which is being checked to be shown due to the checkbox i created without any value assigned to it?

Anyone can assist me on this? Thank you very much.

<?php
    $startDate = strtotime($datefrom);  
    $endDate = strtotime($dateto);  
    $date = $startDate;  

        while( $date <= $endDate) {  
        echo  "<input type='checkbox' name='date'>";
        echo date('d-m-Y', $date) .' ';  
        $date = strtotime('+1 day', $date); 
    }

?>

Recommended Answers

All 2 Replies

echo "<input type='checkbox' name='date' value ='".date('d-m-Y', $date)."'>";

Thanks for your solution. I have tried this before also, but maybe due to tiny mistake and caused it doesn't work. Thanks alot! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.