Jump to content

Any help would be great need to add a loop to my code and am confused!


canadian_angel

Recommended Posts

The thing is I need to write a single script that allows the traveler to calculate how long it will take to travel a specified number of miles based on speed, number of stops, and weather conditions. I need to include code that requires the user to enter numeric values for miles and number of stops. I need to use a radio button that allows users to select good or bad weather. The predetermined miles per hour is 50mph. This is what I have so far, now I am stumped.

 

<form action="passenger_train.php" method="post">

 

        Speed: <input type="radio" name="speed[]" value="50mph" /> 50 Mph

        <br />

        <p>Weather Conditions:</p>

          <input type="radio" name="weather[]" value="wet" /> Wet

          <input type="radio" name="weather[]" value="dry" /> Dry

          <br />

        Miles: <input type="text" name="miles" size="5" />

        <br />

        Stops: <input type="text" name="stops" size="5" />

        <br />

     

          <input type="submit" name="submit" value="Calculate" />

    </form>

 

<?php

for($i = 0, $x = $nums['x_val'];

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.