Got some code from another site and I tried to modify it to fit.
It's supposed to get a (MySQL) country table, display it in a form and allow me to choose a country which I will put in the user table.
Here's the code part that I have a problem with:
<td><form method="post" action="update_profileck.php" font face='Verdana' size='2'>Country</td>
<td><font face='Verdana' size='2'>
<?
$query="SELECT * FROM country";
$result = mysql_query ($query);
echo "<select name=countryname value=''></option>";
echo "<option value=''>$country</option>";
echo "<option value='selected'></option>";
while($nt=mysql_fetch_array($result)){
echo "<option value=$nt[id]>$nt[countryname]</option>";
/ Option values are added by looping through the array /
}
echo "</select>"
?>
Select from drop-down list.</td></tr>
</form>
</td>
It does everything except when I select a country the selection does not go into the $_POST array. How do I put it there?
I guess my code is not too elegant, but I'm new at this, give me a couple of months people.