Overall goal: User enters some number in minutes and I change those numbers from minutes to some usable form in a calculation.
How do I convert the user input in the form of minutes to some number or value that I can use later on in this php script?
<?php
$minutes = $_REQUEST["minutes"];
// We initialize the total to $1.99 for the connection fee:
$total = 1.99;
// For each additional minute we add $0.45?
// For example if 3 minutes are used the cost = $2,
$addmin = 0.45;
/* How do I convert the user inputted minutes to some value
I can manipulate with php so that I can just add via php and give the user
a cost, for example, 3minutes entered into a form might be = cost of $2.
What do I need to read or study?*/
//We use a if statement here:
if (filter_has_var(INPUT_POST, "minutes"))
{
// If the user selects the number of minutes, we echo out the number of minutes.
print $minutes;
print "mins.";
// Condition pending here:
$total += filter_input(INPUT_POST, "$addmin");
}
print "<p>The total cost is: \$$total</p>
";
?>