Results 1 to 3 of 3

Thread: [RESOLVED] Loop Years Through Combo Box

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Resolved [RESOLVED] Loop Years Through Combo Box

    I want to make a loop to start from 50 years go to 13 years ago from this year.


    I want to display them in a Combobox (dropdown) for a Join us page. This will help with age verification (kinda).

    so for this year it should display 1957 - 1994. I have this much code:

    PHP Code:
    $startdate date("Y") - 50;
    $enddate date("Y") - 13
    i just dont know the loop part...
    My usual boring signature: Something

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Loop Years Through Combo Box

    Years are just integers...

    for ($year = $startdate; $year <= $enddate; ++$year)

  3. #3

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Loop Years Through Combo Box

    thats pena
    My usual boring signature: Something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width