Getting an undefined variable: pay
error.
It still puts out the paycheck amount... I just want the notice to go away. Provide new code if any please :)
$hours = (int) $_GET["hours"];
$wages = (int) $_GET["wage"];
$overtime = max($hours - 40, 0);
$pay += $overtime * $wages * 1.5;
$pay += ($hours - $overtime) * $wages;
echo "Hours Worked: " . $hours . "<br>";
echo "Pay rate (per hour): $" . number_format($wages, 2) . "<br>";
echo "Overtime Hours: " . $overtime . "<br>";
echo "Your Paycheck is: $" . number_format($pay, 2) . "<br>";
If you need any more info than what I have provide please let me know. I dont think I need to post the html stuff etc. Thanks again!