Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down with years in

Status
Not open for further replies.

MJB3K

Programmer
Jul 16, 2004
524
GB
Hi, how would you go about making a drop down box with the current year in, and say 5years after??

e.g.

2004 <<current year
2005
2006
2007
2008
2009

any ideas??


Regards,

Martin

Gaming Help And Info:
 
i found a solution!

if anybody else is interested:
Code:
  <select name="select">
  <?php
	$d = date("Y");
	$yearsAfter = 10;
	for($i=$d;$i<$d+$yearsAfter+1;$i++){
		echo "<option value=$i>$i</option>";
	}
	?>
  </select>
</form>

Regards,

Martin

Gaming Help And Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top