Ameslee Posted January 16, 2007 Share Posted January 16, 2007 I cant work out why there is a problem with the following code[code]<td>Date<td><select name="month"><option value="$month">$newmonth</option><option value="01">January</option><option value="02">February</option><option value="03">March</option><option value="04">April</option><option value="05">May</option><option value="06">June</option><option value="07">July</option><option value="08">August</option><option value="09">September</option><option value="10">October</option><option value="11">November</option><option value="12">December</option></select><select name="day"><option value="$day">$day</option>events;$x=1;while($x<=31){ echo "<option value=$x>$x</option>"; $x++;}echo "</select>";echo "<select name='year'>";echo "<option value=$year>$year</option>";$y=2007;while($y<=2020){ echo "<option value=$y>$y</option>";$y++;}[/code]i was just updating a site and i changed the $y=2007, coz it was 2006 and now when it displays theres two 2007's, why?plz help thanks Link to comment https://forums.phpfreaks.com/topic/34349-display-day-month-year/ Share on other sites More sharing options...
kobmat Posted January 16, 2007 Share Posted January 16, 2007 I think you should remove this lineecho "<option value=$year>$year</option>"; Link to comment https://forums.phpfreaks.com/topic/34349-display-day-month-year/#findComment-161613 Share on other sites More sharing options...
Ameslee Posted January 16, 2007 Author Share Posted January 16, 2007 alright thanks, that did it! Link to comment https://forums.phpfreaks.com/topic/34349-display-day-month-year/#findComment-161619 Share on other sites More sharing options...
john_6767 Posted January 16, 2007 Share Posted January 16, 2007 don't know if this helps but if you are just changing it to the current year every year you can use [code=php:0]echo date("y");[/code] to print the current year.. so no need for updates every year ;) Link to comment https://forums.phpfreaks.com/topic/34349-display-day-month-year/#findComment-161697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.