Hey all,
I'm a real dummy/newby, so sorry if the question is very silly to you.
I tried to write code to calculate the (as the crow flies) distance between cities.
Therefore, I need the user of an interface to choose a city of departure and a city of arrival.
I'd like to enable the user to select the city from a list or to insert the latitude/longitude of the cities himself if the city is not in the list.
This is my current attempt for the first page (the selection of the city of departure)
<html>
<head><title>Select city of departure</title></head>
<body>
<form method="post" action="calculate.php">
<table width="50%">
<tr>
<td width="50%">Please select the city of departure:</td>
<td><select name="departure" size="1">
<option value="london"> London
<option value="paris"> Paris
<option value="madrid"> Madrid
</select><br></td>
</form>
<br>
</tr>
</table>
<form>
<table>
<tr>
//here the user will have to insert the longitude and latitude in degrees and minutes for departure
<td>If your departure city is not in the list, please provide its latitude and longitude</td>
</tr>
<tr>
<td>Longitude:</td>
<td><input type="text" name="departurelondeg" size="5"> °</td>
<td><input type="text" name="departurelonmin" size="5"> '</td>
<td><input type="text" name="departurelonsec" size="5"> "</td>
</tr>
<tr>
<td>Latitude:</td>
<td><input type="text" name="departurelatdeg" size="5"> °</td>
<td><input type="text" name="departurelatmin" size="5"> '</td>
<td><input type="text" name="departurelatsec" size="5"> "</td>
</tr>
<tr>
<td></td>
<td> <input type="submit" value="OK"></td>
</tr>
</table>
</form>
<br>
</body>
</html>
The problem is that I don't know how to combine the submission of the data selected by the user and the forwarding of the user to the next page, where (s)he will have to select the city of arrival.
Anyone having an idea about this?
Many thanks in advance!!!