Page 1 of 1

Drop down box that auto populates years

Posted: Sat Feb 12, 2005 8:35 pm
by jmyers
I am trying to have a drop down box that will auto populate each year starting from 1900 and ending with $currentyear

can someone please help

Thanks

Jeff

Posted: Sat Feb 12, 2005 8:37 pm
by feyd
simple loop:

Code: Select all

$output = '';
for($x = 1900; $x <= $currentyear; $x++)
  $output .= '<option value="' . $x . '">' . $x . '</option>';
echo $output;