File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1414}
1515?>
1616<form action="45_Quadratic_equation_solver.php" method="POST">
17- Enter the coefficients for the Ax<sup>2</sup> + Bx + C = 0
17+ Enter the coefficients for Ax<sup>2</sup> + Bx + C = 0
1818 <table border="0" cellpadding="0" cellspacing="0">
1919 <tr>
2020 <td>
4747<?php
4848/** If the user has submitted the form, then we need to execute a calculation * */
4949if (isset ($ _POST ['submit ' ])) {
50- if ($ _POST ['A ' ] == 0 ) {
50+ if (!is_numeric ($ _POST ['A ' ]) || !is_numeric ($ _POST ['B ' ]) || !is_numeric ($ _POST ['C ' ])) { // validate input
51+ $ helper ->log ('Non-numeric input ' );
52+ } elseif ($ _POST ['A ' ] == 0 ) {
5153 $ helper ->log ('The equation is not quadratic ' );
5254 } else {
5355 // Calculate and Display the results
You can’t perform that action at this time.
0 commit comments