Code: Select all
<p><tab> Date of Birth: <?php //Make the month pull down menu.
//Array to store months.
$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
print '<select name= "month">';
foreach ($months as $key => $value) {
print "\n<option value=\"$key\">$value</option>";
}
print '</select>'; ?> </tab>
<tab> <?php //Make the day pull down menu
print '<select name= "day">';
for ($day = 1; $day <= 31; $day++) {
print "\n<option value=\"$day\">$day</option>";
}
print '</select>'; ?> </tab>
<tab><?php //Make the year pull down menu
print '<select name= "year">';
$start_year = date('Y');
for ($y = ($start_year - 18); $y >= 1900; $y--) {
print "\n<option value=\"$y\">$y</option>";
}
print '</select>'; ?> </tab> </p>