|
Posted by linda on 11/17/06 02:10
Ok, I have another question! How can I get the year to run from 2006 back
to
1945?
Many thanks in advance as always,
Linda
// This function makes three pull down menus for day, month and year.
function date_of_birth(){
//Make the days pull down
echo '<select name="day">';
for ($day = 1; $day <= 31; $day++) {
echo "<option value=\"$day\">$day</option>\n";
}
echo '</select>';
//Make the months
$months = array (1 => 'January', 'Febuary', 'March', 'April', 'May',
'June', 'July', 'August', 'September', 'October', 'November', 'December');
//Make the months pull down.
echo '<select name="month">';
foreach ($months as $key => $value){
echo "<option value=\"$key\">$value</option>\n";
}
echo '</select>';
//Make the years
echo '<select name="year">';
for ($year = 1945; $year <= 2006; $year++) {
echo "<option value=\"$year\">$year</option>\n";
}
echo '</select>';
}//End of date of birth function.
[Back to original message]
|