hi. i have the following code:
$now=getdate();
$currMonth = $now["month"];
$currYear = $now["year"];
$currDay = $now["mday"];
for($i=1; $i<=12; $i++){
$month = date("F",mktime (0, 0, 0, $i));
if ($month == $currMonth)
echo "<option value='".$month ."' selected='selec ted'>".$month." </
option>";
else
echo "<option value='".$month ."'>".$month ."</option>";
}
all i want to do is dynamically output a selection box containing all
the months of the year, and have the selection default to the current
month. however, i'm not sure why it's not working. please help.
thanks
$now=getdate();
$currMonth = $now["month"];
$currYear = $now["year"];
$currDay = $now["mday"];
for($i=1; $i<=12; $i++){
$month = date("F",mktime (0, 0, 0, $i));
if ($month == $currMonth)
echo "<option value='".$month ."' selected='selec ted'>".$month." </
option>";
else
echo "<option value='".$month ."'>".$month ."</option>";
}
all i want to do is dynamically output a selection box containing all
the months of the year, and have the selection default to the current
month. however, i'm not sure why it's not working. please help.
thanks
Comment