php date choose from drop down list min and max -


i have code:

<tr><td>data expirare:</td><td><?=date_chooser("date",date("y-m-d"),0)?></td></tr> 

it working properly, @ moment 1920 until 2050 , want show me of pending , next 5 years.

i assume using date_chooser() algorithm post: how jump anchor on submit - not top of page or internet page: http://ideone.com/ab0cld

i adapted small part of code adding 2 variables: $from_year , $to_year. define range of years in drop down. can adapt value of variables needs.

$chooser.="<select name='".$name."year'>"; $from_year = 1950 $to_year = date("y") + 5    for($i=$from_year;$i<=$to_year;$i++)    {       if($i==$year) $selected='selected';       else $selected='';       $chooser.="<option $selected>$i</option>";    } 

Comments