What I want is the number entered in the text box to become the variable - $quantity. This is an example out of a book I bought, but I decided to take it one step further with the form. I am lost on the print statements and why the use of - $$discount and $$totalcost....why the double $$ ??
I am in the process of learning php/programming.
Here is my numbers.php file.
<html>
<head>$$totalcost.
<title>Using Numbers</title>
</head>
<body>
<?php
$cost = 2000.00;
$tax = 0.06;
$totalcost = $cost $quantity;
$tax = $tax + 1;
$totoalcost = $totalcost - $discount;
$totalcost = $totalcost $tax;
$payments = $totalcost / 12;
print ("you requested to purchase $quantity widget(s) at \$$cost each.\n<p>");
print ("the total with tax, minus your \$$discount, comes to \$$totalcost.\n<p>");
print ("you may purchase the widget(s)in 12 monthly installments of \$$payments each.\n<p>");
?>
</body>
</html>
Here is my widgets.html file:
<html>
<head>
<title>Order</title>
</head>
<body>
<h3><center><b>Place Widgets Order</b></center></h3>
<FORM ACTION ="numbers.php" METHOD=POST>
quantity <input type=text
NAME="quantity" SIZE=10><br>
<INPUT TYPE=SUBMIT NAME="SUBMIT"
VALUE="Submit!">
</body>
</html>