]> git repositories - basic-calc.git/commitdiff
merge v2 to main main
authorbochard <mail@tenkyuu.dev>
Wed, 7 May 2025 13:14:28 +0000 (21:14 +0800)
committerbochard <mail@tenkyuu.dev>
Wed, 7 May 2025 13:14:28 +0000 (21:14 +0800)
backend.php [deleted file]

diff --git a/backend.php b/backend.php
deleted file mode 100644 (file)
index 8566bb3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-  if(isset($_GET["calculate"])){
-    $input1 = (float) $_GET["num1"];
-    $input2 = (float) $_GET["num2"];
-    $operator = $_GET["operation"];
-    $result = null;
-
-    if(empty($input1) || empty($input2)){
-      echo "specify a number into the first and second input.";
-      return;
-    }
-    elseif($operator == "select"){
-      echo "select an operation.";
-      return;
-    }
-
-    switch($operator){
-      case "add":
-        $result = $input1 + $input2;
-        echo "The sum is {$result}";
-        break;
-      case "subtract":
-        $result = $input1 - $input2;
-        echo "The difference is {$result}";
-        break;
-      case "multiply":
-        $result = $input1 * $input2;
-        echo "The product is {$result}";
-        break;
-      case "division":
-        $result = $input1 / $input2;
-        echo "The quotient is {$result}";
-        break;
-    }
-  }
-?>
\ No newline at end of file