Ok guys i am working on a program that will compute the distance in miles from Chicago or dallas(radio buttons)to specific destinations. The destination cities are in a selection list. The output should be the distance between the two cities, the time it would take to drive at 60 mph. and the time it would take to walk at 5 mph. the following code that i wrote only displays the headings for output. Please tell me where i am going wrong with this.
<?php
$cities =array ('Dallas' => 803, 'Toronto' => 435, 'Boston' => 848, 'Nashville' => 406, 'Las Vegas' => 1526, 'San Francisco' => 1835,
'Washington, DC' => 595, 'Miami' => 1189, 'Pittsburgh' => 409);
$cities2 = array ('Chicago' => 803, 'Toronto' => 1202, 'Boston' => 1548, 'Nashville' => 615, 'Las Vegas' => 1073, 'San Francisco' => 1483,
'Washington, DC' => 1181, 'Miami' => 1107, 'Pittsburgh' => 1068);
if (isset($_POST['dal']) && isset($cities['destination'])) {
$distance = $cities['destination'];
if (isset($_POST['chi']) && isset($cities['destination'])){
$distance = $cities2['destination'];
$time = round(($distance / 60), 2);
$walktime = round(($distance / 5), 2);
print "The distance between Chicago and <i>['destination']</i> is $distance miles.";
print "<br> Driving at 60 Miles per hr. it would take $time hrs.";
print "<br> Walking at 5 Miles per hr. it would take $walktime hrs.";}
else {
print "Please select a Starting city and a Destination.";}}
?>