This is a basic question I'm sure....
I have a normal form, but one of the fields is a Country dropdown menu that I am populating with an external xml script:
<?php
//Build countries dropdown from GeoNames database
$xmlcountries = 'http://ws.geonames.org/countryInfo';
echo '<select name="custom_country" id="custom_country">';
$countries = simplexml_load_file($xmlcountries);
echo '<option value="">Your country</option>';
foreach ($countries->country as $country) {
echo '<option value="'.$country->geonameId.'|'.$country->countryName.'">'.$country->countryName.'</option>';
}
echo '</select>';
?>
My form is this:
<form action="update.php" method="post">
Country:<br />
<input type="text" name="Country" size="100" /><br />
State:<br />
<input type="text" name="State" size="100" /><br />
City:<br />
<input type="text" name="City" size="100" /><br />
<input type="submit" value="Update Database" />
</form>
I'd like the above $country variable to take the place of the name="Country" field in the form. How do I do that?
To be clear-when I submit the form, I want the value from the country dropdown to populate the $_POST['Country'].