stvchez Posted February 24, 2007 Share Posted February 24, 2007 Hi, i'm attempting to do a simple conditional select of by the url date variable. here's the month get: $m = $_GET['m]; // m = 2 <select name="date_month"> <OPTION VALUE="01">01</OPTION> <OPTION VALUE="02">02</OPTION> <OPTION VALUE="03">03</OPTION> <OPTION VALUE="04">04</OPTION> then, something along lines of: if ($m == ...) { echo"SELECTED"; } Link to comment https://forums.phpfreaks.com/topic/39914-conditional-select/ Share on other sites More sharing options...
utexas_pjm Posted February 24, 2007 Share Posted February 24, 2007 <OPTION VALUE="04" <?=($m =='04' ? ' SELECTED' : '')?>>04</OPTION> Link to comment https://forums.phpfreaks.com/topic/39914-conditional-select/#findComment-192937 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.