From 3990173db1207767139e63d33783beafada57007 Mon Sep 17 00:00:00 2001 From: oleibman <10341515+oleibman@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:27:28 -0700 Subject: [PATCH] Validate POST Input in Sample 45 Errors will result if inputs are not numeric. --- samples/Basic4/45_Quadratic_equation_solver.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/Basic4/45_Quadratic_equation_solver.php b/samples/Basic4/45_Quadratic_equation_solver.php index 30aabf60f5..d681a21092 100644 --- a/samples/Basic4/45_Quadratic_equation_solver.php +++ b/samples/Basic4/45_Quadratic_equation_solver.php @@ -14,7 +14,7 @@ } ?>
- Enter the coefficients for the Ax2 + Bx + C = 0 + Enter the coefficients for Ax2 + Bx + C = 0
@@ -47,7 +47,9 @@ log('Non-numeric input'); + } elseif ($_POST['A'] == 0) { $helper->log('The equation is not quadratic'); } else { // Calculate and Display the results