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

Posted by linda on 11/18/06 21:14

"MS" <MS@nospam.com> wrote in message
news:X6SdnSEfJNJKxcLYnZ2dnUVZ8tKdnZ2d@bt.com...
> >
>> for ($year=2006; $year>=1945; $year--) {
>>
>
> The above will work fine as you have found, but if you hard code the Years
> then next year, and subsequent years, you will need to change your code to
> allow for year 2007, 2008 etc...
>
> You may find this helpful
>
> for ($year=date('Y'); $year>=(date('Y')-100); $year--) {
>
> this will list the previous 100 years !!
>
> MS
> ----
> Join MyClubWeb.co.uk - The Home of Club Websites and Medium to Small
> Businesses.
>
>

Hi MS,

You must have been looking over my sholder lol... i did this very same thing
this after noon like this:

//Make the years
$thisyear = date('Y');

echo '<select name="year">';
for ($year=$thisyear; $year>=1945; $year--) {
echo "<option value=\"$year\">$year</option>\n";
}
echo '</select>';

Will you please stay out of my bedroom ;-)

Best wishes,
Linda

 

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

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