+ 1
It's probably because of security reasons at sololearn code playground. 1st look at your code: 1. you typed 'output.php' in form action field, but you don't know the local script name 2. correct form : method = "POST" 3. change checking existence of variable (line 26) and reorder 'if' statement: if(isset($_POST["n1"]) && ($_POST["n1"] != "") && isset($_POST["n2"]) && ($_POST["n2"] != "") && isset($_POST["operation"])) { $n1 = doubleval($_POST["n1"]); $n2 = doubleval($_POST["n2"]); $operation = $_POST["operation"]; if ($operation == "/" && $n2 == 0) echo "it is not possible"; else { if ($operation == "+") $res = add($n1, $n2); else if ($operation == "-") $res = sub($n1, $n2); else if ($operation == "*") $res = mult($n1, $n2); else $res = divi($n1, $n2); echo "$n1 $operation $n2 = $res"; } } else echo "please fill the two slots"; your script works outside Sololearn Code Playground if script's filename is 'output.php', you can test it on your local computer for example
31st May 2017, 11:26 AM
Michal
Michal - avatar