|
Posted by NC on 11/19/75 11:45
Kentor wrote:
>
> does anyone know of a script that would produce a calendar starting
> from todays date with checkboxes next to every day of the month so that
> the user is able to check it in case of an event for that day...
> without specifying what the event is... just a simple checkbox..
Something like this should do the trick:
$timestamp = time();
$month = date('m', $timestamp);
while ($month == date('m', $timestamp)) {
$dateMDY = date('F j, Y', $timestamp);
$dateYMD = date('Y-m-d', $timestamp);
echo "<input type='checkbox' name='dates[]' ",
"value='$dateYMD'>$dateMDY<br>\r\n";
$timestamp = $timestamp + 24*60*60;
}
This will give you a checkbox for every day from today until the end of
the current month... The list (or, rather, array) of checked dates
will be available to the receiving script as $_POST['dates'] or
$_GET['dates'], depending on what method the form uses.
Cheers,
NC
[Back to original message]
|