Here is a SNIPPET of my codeing: <select name="newcountry" id="newcountry"> <option <? $val="Afganistan"; echo "value=\"".$val."\""; if ($country == $val) echo "selected"; ?>Afghanistan</option> <option <? $val="Albania"; echo "value=\"".$val."\""; if ($country == $val) echo "selected"; ?>Albania</option> </select> PHP: This is the HTML output: <select id="newcountry" name="newcountry"> <option value="Afganistan" selected option Afghanistan<></option> <option value="Albania" option Albania<></option> </select> HTML: Get it? .. I dont.. Well confused. Point of this code? This is going to be a form, which people can select their country, and submit it to a html databse. All that works. The php codeing in the form is theire to set it so, if a user sets their country to UNITED KINGDOM when they go to edit their profile, their country is still UNITED KINGDOM
or copy and paste: <select name="newcountry" id="newcountry"> <option <? $val="Afganistan"; echo "value=\"".$val."\""; if ($country == $val) echo " selected"; ?>>Afghanistan</option> <option <? $val="Albania"; echo "value=\"".$val."\""; if ($country == $val) echo " selected"; ?>>Albania</option> </select> PHP: outputs <select name="newcountry" id="newcountry"> <option value="Afganistan" selected>Afghanistan</option> <option value="Albania">Albania</option> </select> HTML: