here's what i have:
Code: Select all
<?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.";}}
?>