Print current and next three years

Print current and next three years

Post by shau » Thu, 25 Sep 2003 21:29:39


Hi,

I am trying to print the current and next three years in a form. Using the
following code I can only print 2000, 2001, 2002, 2003:

<select name="start_date_year">
<?php
$i = 1;
while ($i <= 4){
if ($i + 1 == date("Y", strtotime($_GET[mysql_date]))){
echo '<option value="'.date("Y", mktime(0, 0, 0, 0, 0, $i)).'"
selected>'.date("Y", mktime(0, 0, 0, 0, 0, $i)).'</option>';
} else {
echo '<option value="'.date("Y", mktime(0, 0, 0, 0, 0,
$i)).'">'.date("Y", mktime(0, 0, 0, 0, 0, $i)).'</option>';
}
$i++;
}
?>
</select>

How can I get this code to start looping from the current year?

Thanks for your help