selliott Posted January 28, 2010 Share Posted January 28, 2010 Hello, I have this code to generate a drop down list of years, but need to adjust it so that when a date is selected, it takes you to /schedule?Year=(selected year here) Thanks $thisYear = date('Y'); $startYear = "2009"; $selectYear = ($thisYear); print 'Year: <select name="Year">'; foreach (range($thisYear, $startYear) as $year) { $selected = ""; if($year == $selectYear) { $selected = " selected"; } print '<option' . $selected . '>' . $year . '</option> '; } print '</select>'; Link to comment https://forums.phpfreaks.com/topic/190073-need-this-dropdown-to-go-to-link/ Share on other sites More sharing options...
teamatomic Posted January 28, 2010 Share Posted January 28, 2010 Wont work that way. You need to use it as a post and call schedule.php in the action. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/190073-need-this-dropdown-to-go-to-link/#findComment-1002832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.