|
|
|
<?php
//
//
//Can be used with database and creditcard expiary or registration functions.
//
//
/////function to create a year range /////////////////////
function createyrrange($yr)
{
$i=$yr-5;
$j=$yr+5;
for(;$i<=$j;$i++)
{
if($i==date("Y"))
print "<option value='$i' selected>$i</option>";
else
print "<option value='$i'>$i</option>";
}
}
/////function to create a <b>numeric</b> month range /////////////////////
//// in the function below 7 & 05 are the month and year you are not required to change these its just to use the feature of the mkdate function without any problem
function createmthrange()
{
for($i=01;$i<=12;$i++)
{
if($i==date("m")){
print "<option value='$i' selected>".date("M", mktime(0, 0, 0, $i,7,05))."</option>";
///// use the following line to print the date in numeric format
// print "<option value='$i' selected>$i</option>";
}
else{
print "<option value='$i'>".date("M", mktime(0, 0, 0, $i,7,05))."</option>";
///// use the following line to print the date in numeric format
// print "<option value='$i'>$i</option>";
}
}
}
/////function to create a date range /////////////////////
function createdtrange()
{
$i=01;
for(;$i<=31;$i++)
{
if($i==date("d"))
print "<option value='$i' selected>$i</option>";
else
print "<option value='$i'>$i</option>";
}
}
/////////// functions are over you can merge all the functions into a single funciton also
print "<select name=date>";
print createmthrange()."</select>"; ///creates a month range from 1 to 12 in numeric
print "<select name=date>";
print createdtrange()."</select>"; ///creates a date range from 1 to 31
print "<select name=date>";
print createyrrange(date('Y'))."</select>"; ///creates an year range from current year to current year + 5 and current year -5
?> |
|
| A Timing Class Categories : PHP, PHP Classes, Date Time | | | Finding the day of the week for a specific date.
Categories : PHP, Databases, MySQL, Date Time | | | pcCalendar class - Allows for the creation of calendars in HTML pages. All output functions can be easily overridden, refer to article 1471 for an example.
Categories : PHP, Date Time, Calendar, PHP Classes | | | A PHP Calendar function with CSS : add a cool calendar to any php page by just adding a calendar class based function. Categories : PHP, PHP Classes, Calendar, Date Time | | | A wrapper function to format dates coming from a databases with the
same syntax as PHP's date() function. Categories : Date Time, Databases, PHP | | | PHP Round Clock - Must have Gif support to use this. Categories : PHP, Date Time, Graphics | | | A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed. Categories : Date Time, PHP, Complete Programs, Calendar | | | Open and Close your website in fixed times . Categories : PHP, PHP Classes, Cron, Date Time | | | mysql date/time converters Categories : PHP, MySQL, Databases, Date Time | | | If you want to create select buttons featuring current date this example will show you how... Categories : Date Time, HTML and PHP, PHP | | | Creates three SELECT form fields: Month, Day, and Year. You give it a string which will be used to make the name for the three fields, and a number of seconds to use as the default date. If you give it blank for this value, the current date is used. Categories : HTML and PHP, PHP, Date Time | | | Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example. Categories : PHP, Date Time, PHP Classes, Calendar | | | Monthly and Daily Upcoming Events calendar. Categories : Date Time, PostgreSQL, PHP, Calendar, Databases | | | calculus of the eastersunday Categories : BC math, PHP, Date Time, Databases | | | Functions used to define a schedule of holidays. Can define non-fixed holidays (eg. 3rd sunday of June). Categories : Calendar, Date Time, PHP | |
|
|
|