I currently have a selection (drop down box) which shows a list of dates, here is the code;
Code: Select all
<?
$leap = array(1, 0, 0, 0, 1, 0); //<- Not accurate! Look up the leapyears.
$years = array(2005, 2006, 2007); //<- List of years
echo "<SELECT NAME=datetwo><OPTION>Choose One</OPTION>n";
foreach ($years as $year) { //Cycle thru years
for ($i = 1; $i<=12; $i++) { //Cycle thru months
$day = 1; //Start at day 1
while ($day <= date('t', $month = mktime(0, 0, 0, $i, 1, $year))) { //Cycle thru days
echo "<OPTION VALUE=\"{$day}-"
.date('m', $month)
."-{$year}\">{$day}-"
.date('m', $month)."-{$year}</OPTION>\n";
$day++;
}
}
}
echo "</SELECT>\n";
?>My question - I need to set the start point from today's date. I do not want to show any dates from the past as this is going to be my expiry date. If a past date is selected it messes up my output on another page.
Please help.