The html in this form loads in the browser, but when I fill the form and submit the php does not load, just a blank page is show.
I tried separating the files into an html and a php file as well, that didn't work.
<!DOCTYPE html>
<head><title>Calculator</title></head>
<body>
<form action="calculator.php" method="POST">
<p>
<label for="firstnumber">First Number</label>
<input type="text" name="firstnumber" id="firstnumber" />
</p>
<p>
<label for="second number">Second Number:</label>
<input type="text" name="secondnumber" id="secondnumber" />
</p>
<p>
<input type="radio" name="Operation" value="Add" id="addinput" /> <label for="addinput">Add</label>
<input type="radio" name="Operation" value="Sub" id="subinput" /> <label for="subinput">Sub</label>
<input type="radio" name="Operation" value="Mult" id="multinput" /> <label for="multinput">Mult</label>
<input type="radio" name="Operation" value="Div" id="divinput" /> <label for="divinput">Div</label>
</p>
<p>
<input type="submit" value="=" />
<input type="reset" />
</p>
</form>
<?php
$Operation = $_POST['Operation'];
$x = $_POST["firstnumber"];
$y = $_POST["secondnumber"];
if($Operation == "Add"){
echo ($x + $y);
}
if($Operation == "Sub"){
echo ($x - $y);
}
if($Operation == "Mult"){
echo ($x * $y);
}
if($Operation == "Div"){
if ($y==0){
echo "error-cannot divide by zero";
}
else echo = ($x / $y);
}
?>
</body>
</html>