You are here: Re: php calendar to generate checkboxes next to each date « PHP Programming Language « IT news, forums, messages
Re: php calendar to generate checkboxes next to each date

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация