From 14c79c52e68160e794b71408b54ed536ab1c15e3 Mon Sep 17 00:00:00 2001 From: Kilian Hofmann Date: Fri, 3 May 2024 13:32:21 +0200 Subject: [PATCH] Calculator check for all values in submit --- tasks/calc/index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks/calc/index.php b/tasks/calc/index.php index e2382b1..e11b0aa 100644 --- a/tasks/calc/index.php +++ b/tasks/calc/index.php @@ -22,7 +22,7 @@ $result = ""; if ( - array_key_exists("operand1", $_POST) && + isset($_POST["operand1"], $_POST["operand2"], $_POST["operator"]) && is_numeric($_POST["operand1"]) && is_numeric($_POST["operand2"]) ) { @@ -55,7 +55,7 @@
- +
Please enter a number
@@ -66,7 +66,6 @@
Please enter a number
-