You are here: function date_of_birth() « All PHP « IT news, forums, messages
function date_of_birth()

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация