以下是我在表格中接受日期的代码:
$month_array = array( "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December");
echo "<select name='Resolved_date1' style='color:black; font-family: Verdana; font-weight: bold; font-size: 12px; background-color:beige;'>";
$i = 1;
while ( $i <= 31 ) {
echo "<option value=".$i.">".$i."</option>";
$i++;
}
echo "</select>";
echo "<select name='Resolved_date2' style='color:black; font-family: Verdana; font- weight: bold; font-size: 12px; background-color:beige;'>";
$i = 0;
while ( $i <= 11 ) {
echo "<option value=".$i." name='Resolved_date2'>".$month_array[$i]."</option>";
$i++;
}
echo "</select>";
echo $_POST['Resolved_date2'];
echo "<select name='Resolved_date3' style='color:black; font-family: Verdana; font- weight: bold; font-size: 12px; background-color:beige;'>";
$i = 2013;
while ( $i <= 2050 ) {
echo "<option value=".$i.">".$i."</option>";
$i++;
}
echo "</select>";
echo $_POST['Resolved_date3'];
?>
问题是以下语句打印月份编号而不是月份名称: echo $_POST['Resolved_date2']; 有没有办法解决这个问题?另外,我们如何根据月份自定义天数..ike 如果我选择 1 月,我会在下拉列表中获得 31 天,而当我选择 6 月时,我只会在下拉列表中获得 30 天?请帮忙...