In order to get started with the debugging, copy and paste the above code into your Products
page, upload it to your class Web site, and display the Products page. You might see some
Notice: messages regarding Undefined variables. You will certainly see the wrong
sum displayed in the page.
There are at least two different ways to fix the bug:
Pass the variables $number1 and $number2 into the function as
parameters.
Add two "global" statements at the start of the function.
Test your page on the PHP Web server by clicking your student number on the
"Student Sites" page of this class site. Display your Products page. Make sure
the Products page displays the correct sum.