Thanks for the tip, I have tried the error reporting but I get an error for the error_reporting line. I swear the php is just mocking me now. I have tried with and without the ==, =, (, in various combinations just to get something that works. Nothing helped. Here's the latest best working out of many version I have now:
<?php # Script 3.10 - Errors.php #5
error_reporting = -1
display_errors = on
$page_title = 'Errors';
// Set the variable number
$qtySold = $_POST["qtySold"];
$price = $_POST["price"];
$total = $qtySold * $price;
// Check for form submission:
if (isset($_POST['submitted'])) {
// Minimal form validation:
if ( is_numeric($qtySold) && is_numeric($price) ) {
// Print the heading:
echo '<h1>Commission</h1>';
if ($qtySold >= 100){
$commissionRate = 0.03;
}else{
$commissionRate = 0.02;
$commission = $total * $commissionRate;
// Print the results:
echo "<p>Your commission is <b> $commission</b>.";
}
}
else
{
echo "You forgot to enter values!";
}
}
This version doesn't give the "You forgot to enter values!" right off the bat, which is an improvement. It's still giving me 0.03 commission rate for all numbers under 100. I have even tried switching the >= to a <= to get a different result and it spit out the same result. Again, I think it's mocking me.