Someone told me since I have register_globals set to off that I need to use one of the $POST or $GET syntax to pull my form variables. So I am working on Bob's Auto Parts example in the Wellington and Thomson book, PHP and MySQL Web Development. I wrote the following code per their example and it works.
But what I wonder is I use the $POST['tireqty'] syntax like 3 or 4 times to call this variable. Is there a cleaner way to call it once and then reuse it without having to always preface it with the $Post[ ] ????
😕
This is some of the code I am using:
echo $POST['tireqty']." tires<br>" ;
echo $POST['oilqty']." bottles of oil<br>";
echo $POST['sparkqty'] ." spark plugs</p>";
$totalqty = $POST['tireqty'] + $POST['oilqty']
+ $POST['sparkqty'];
$totalamount = $POST['tireqty'] TIREPRICE
+ $POST['oilqty'] OILPRICE
+ $_POST['sparkqty'] * SPARKPRICE;
$totalamount = number_format($totalamount, 2);