I am attempting to make a php script that will calculate the total miles driven by a car rental customer (.12 cents per mile) which multiplies that value to the number of days they rented the car ($15 a day) and display that grand total in a textarea box along with their name and address. I am fairly new to php and I have no clue how to project this idea into php code. I have a fully html version of this code working, but am lacking the knowledge with php to translate it.
Anyone have any ideas on how I can write this script?
<?php if(isset($_POST['submit'])) { $x = $_POST['bOdometer']; $y = $_POST['eOdometer']; $z = $_POST['daysRented']; $miles = $y - $x; { $result = (15 * $z) + ($miles * 0.12); $message = $_POST['textarea']; echo $result + $message; } } ?>Miles Driven: Total Cost:
Summary:
HTML VERSION FOR REFERENCE
Miles Driven: Total Cost:
Summary: