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

Posted by linda on 11/17/06 15:52

"Jeff North" <jnorthau@yahoo.com.au> wrote in message
news:5vnql2dhoorpnpn4p90287df5cnm1kcqg0@4ax.com...
> On Fri, 17 Nov 2006 02:10:55 -0000, in alt.php "linda"
> <n0spamF0rme@tiscali.co.uk>
> <455d1ab4$1_3@mk-nntp-2.news.uk.tiscali.com> wrote:
>
>>| 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++) {
>
> for ($year=2006; $year>=1945; $year--) {
>
>>| echo "<option value=\"$year\">$year</option>\n";
>>| }
>>| echo '</select>';
>>|
>>|
>>| }//End of date of birth function.
>>|
>>|
> ---------------------------------------------------------------
> jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
> ---------------------------------------------------------------

Hi jeff,

thank you! I did this but it wouldn't work, then I realised where I'd made
my mistake I still had the increment by 1 and hadn't changed it to decrement
by 1 as you've done! Sigh, just one little mistake, and do you think i
could find it last night? Learning php can be so hard.

thank you again!
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

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