> How do I create a drop down list that automatically
> generates a list of months for the next 12 months upto and including
this month
This would do it...
<select name="st_month" style="width: 80px" class="forms">
<?PHP
$curr_month = date("n", mktime());
for ($x = 1; $x <= 12; $x++)
{
$month_name = date("F", mktime(0, 0, 0, $x, 1, 2002));
if ($x == $curr_month)
{
echo " <option value=\"$x\" selected>$month_name</option>\n";
} else {
echo " <option value=\"$x\">$month_name</option>\n";
}
}
?>
</select>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php