Hillary Posted March 27, 2009 Share Posted March 27, 2009 I'm making a pace calculator... well, trying to. how would I label each option's distance? make them each their own variable and label them by the value number? What else do i have to do? I'm so confused!!!!!! :-\ <html> <body> <?php //paceCalculator $speed = S $distance = D $time = T if(S) { if($operator == '/') { echo $distance / $time; ?> <form method="POST" action="paceCalculator.php"> <select name="D"> <option value="1">1 mile<option> <option value="2">2K<option> <option value="3">3K<option> <option value="4">2 miles<option> <option value="5">5K<option> <option value="6">8K<option> <option value="7">5 miles<option> <option value="8">10K<option> <option value="9">12K<option> <option value="10">15K<option> <option value="11">10 miles<option> <option value="12">20K<option> <option value="13">Half Marathon<option> <option value="14">25K<option> <option value="15">30K<option> <option value="16">20 miles<option> <option value="17">40K<option> <option value="18">Marathon<option> <option selected="selected" ></option> </select> <form method="POST" action="paceCalculator.php"> <input type="text" name="T" size="10"> <input type="submit" value="Calculate"> </form> <?php } printf " Your speed is "$speed"."; ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/151439-pace-calculator/ Share on other sites More sharing options...
Daniel0 Posted March 27, 2009 Share Posted March 27, 2009 You might want to look up on the PHP syntax using the manual first. Quote Link to comment https://forums.phpfreaks.com/topic/151439-pace-calculator/#findComment-795467 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.