<?php
// This script make three pull-down menus
// for an html form: months, days, years.
//Make the months array:
$months = array(1 => 'January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
//Make the days and years arrays:
$days = range(1,31);
$years = range(2008, 2018);
//Make the months pull-down menu:
echo '<select name="month">';
foreach ($months as $months => $value){
echo "<option value=\"$months\">$value</option>\n";
}
echo '</select>';
//Make the days pull-down menu:
echo '<select name="day">';
foreach ($days as $days => $value){
echo "<option value=\"$value\">$value</option>\n";
}
echo '</select>';
//Make the years pull-down menu:
echo '<select name="year">';
foreach ($years as $years => $value){
echo "<option value=\"$value\">$value</option>\n";
}
echo '</select>';
?>
preferences:
28.47 ms | 402 KiB | 5 Q