This is my second program and I keep getting the below error. I am hoping someone can help me before I throw my laptop. Thanks in advance.
Notice: Undefined index: hours in C:\xampp\htdocs\CHPT4\paycheck.php on line 12
Notice: Undefined index: wage in C:\xampp\htdocs\CHPT4\paycheck.php on line 13
Hours Worked:
Standard Pay:0
Overtime Pay:-60
Your total paycheck is: $-60
It seems like it is telling me that wage and hours aren’t declared in the HTML portion but to me it looks like they are:
<!DOCTYPE htm PUBLIC "-//W3c//DTD XHTML 1.0 Strict//EN" /* Paycheck Form * /Paycheck Form
First Name:
Last Name:
Hourly Wage:
Hours Worked:
Also, this is the PHP form portion:
<!DOCTYPE htm PUBLIC "-//W3c//DTD XHTML 1.0 Strict//EN" /* Paycheck PHP * / <?php$hours = $_GET[“hours”];
$wages = $_GET[“wage”];
$overtime = ($hours - 40)1.5;
$spay = ($hours <= 40)$wages;
echo “Hours Worked:” . $hours . “
”;
echo “Standard Pay:” . $spay . “
”;
echo “Overtime Pay:” . $overtime . “
”;
echo “Your total paycheck is: $” . number_format($spay + $overtime). “
”;
?>