I currently found this date function a while back that works fine ( can't remember where i found it) but it displays all days, months and years from 2013. The problem is now I need people to be able to select 2014 from the drop down as well. Not really sure what I should edit to add this.
Thanks for any help... the code:
function date_dropdown($year_limit = 0){
$daynow = date("d");
$monthnowtxt = date('F');
$monthnow = date('m');
$yearnow = date("20y");
$html_output = '<div id="date_select" >'."\n";
$html_output .= '<label for="date_day">Date of Longplay</label>'."\n";
/*days*/
$html_output .= '<select name="date_day" id="day_select"><option ="selected" value="' . $daynow . '">' . $daynow . '</option>'."\n";
for ($day = 1; $day <= 31; $day++) {
$html_output .= '<option>' . $day . '</option>'."\n";
}
$html_output .= '</select>'."\n";
/*months*/
$html_output .= '<select name="date_month" id="month_select" ><option selected="selected" value="' . $monthnow . '">' . $monthnowtxt . '</option>'."\n";
$months = array("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
for ($month = 1; $month <= 12; $month++) {
$html_output .= ' <option value="' . $month . '">' . $months[$month] . '</option>'."\n";
}
$html_output .= '</select>'."\n";
/*years*/
$html_output .= '<select name="date_year" id="year_select"><option ="selected" value="' . $yearnow . '">' . $yearnow . '</option>'."\n";
for ($year = 1900; $year <= (date("Y") - $year_limit); $year++) {
$html_output .= ' <option>' . $year . '</option>'."\n";
}
$html_output .= '</select>'."\n";
$html_output .= '</div>'."\n";
return $html_output;
}