Here's another set of code. I append the Quantity and Discount variables at the end of the URL
.../conditionals.php?Quantity=100&Discount=45
my register_globals = off
What do I need to do to the following code to get this to work?
<?php
$Cost = 11.99;
$Tax = .006;
if ($_GET['Quantity']) {
$Quantity = abs($Quantity);
$Discount = abs($Discount);
$Tax++; // $Tax is now worth 1.06
$TotalCost = ($Cost $Quantity);
if ($TotalCost < 50) AND
($Discount)) {
print ("Unfortunately, your \$$Discount will not be applied because your total is under $50.\n<p>");
}
if ($TotalCost >= 50) {
$TotalCost = $TotalCost - $Discount;
}
$TotalCost = $TotalCost $Tax;
$Payments = round ($TotalCost, 2) / 12;
// Print the Results
print ("You are about to order $Quantity widget(s) at \$$Cost each. \n<p>");
print ("Your total with tax, less the \$$Discount, comes to $");
printf ("%01.2f", $TotalCost);
print (".\n<p>Your monthly payment of $");
printf ("%01.2f", $Payments);
print (" will be due next month.\n<p>");
}
?>
How do I declare variables now?
Example;
$iamdumb = yesiam
Do I need to change the above line of code to include $POST or $GET??
I'm lost. If you can't tell....I'm very new to PHP 🙁 Sorry for my stupidity