Skip to content
Advertisement

Average Calculation for PHP with variable issue

Morning Everyone,

I am trying to troubleshoot this code. I have made progress, but I am doing a simple average calculation. When I try and declare a variable before using it I have issues. When I try to just use it I get errors saying declare a variable.

Any idea what I am doing incorrectly on the $Average portion. I either can’t render the page or I get 0.00 because when I declare the variable I don’t have an input for it yet.

JavaScript

Advertisement

Answer

In your if else codes , your values can’t arrive calculation line. I edited this part and include isset for $one , $two , $three :

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement