Hello, I am new on this website. I don't know rather I am in the right place or not. I am currently in college and study to be web developer. I am doing good so far! I really need help on this small part. We are working on Mulipulating Strings. The assignment wants me to make script for person to enter how many miles to travel, and how many stops in 2 different weather condition. Good weather to travel 50 mph while bad weather travel 40 mph. Each stop add up 5 minutes. The assignment want one script, not using .html plus .php. Only one php that has both in one. This is what I got so far, the good weather works! but the bad weather is also work and it has line 40 that it didn't like! How do i figure this out? What did I do wrong?
<body>
<form action="PassengerTrain.php" method="get"
enctype="application/x-www-form-urlencoded">
<h1>Passenger Train</h1>
<h3>Number of miles</h3>
<input type="text" name="mile" size="6">
Miles<br />
<h3>Number of stops</h3>
<input type="text" name="stop" size="3">
Stops
<h3>Please Select Weather Condition</h3>
<input type="radio" name="good" />
Good Weather Condition<br />
<input type="radio" name="bad" />
Bad Weather Condition
<p><input type="reset" />
<input type="submit" />
</form>
<?php
While($_GET) {
$k = $_GET['mile'];
$l = $_GET['stop'];
$MinTotal = $l*.05;
if ($_GET['good']) {
$MilTotal = $k/50;
echo "You selected Good Weather Condition and to travel $k miles with $l stops;
the total hours/minutes are ", $MilTotal+$MinTotal;
break;
}
if ($_GET['bad']) {
$MilTotal = $k/40;
echo "You selected Bad Weather Condition and to travel $k miles with $l stops;
the total hours/minutes are ", $MilTotal+$MinTotal;
break;
}
}
?>
</body>