krs10_s Posted February 19, 2009 Share Posted February 19, 2009 need to calculate the average speed a cyclist should go based on distance and time. using forms and POST methods, if the person enters say 5 hours and 10 minutes how do i do calculations with these in the other page?? here's the code of the form: <label>Hours</label> <input type="text" name="hour"size="2"></input> <label>Minutes</label> <input type="text" name="minute"size="2"></input> is the question clear??? Link to comment https://forums.phpfreaks.com/topic/145910-need-help-with-sums-using-forms/ Share on other sites More sharing options...
krs10_s Posted February 19, 2009 Author Share Posted February 19, 2009 Does this look like i'm going in the right direction?? <?php $hour=$_POST['hour']; $distance=$_POST['distance'] $average=$distance/$hour $average=round($average,2) print $average ?> Link to comment https://forums.phpfreaks.com/topic/145910-need-help-with-sums-using-forms/#findComment-766068 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.