I am making a simple calculator that takes input from user in two fields and then echo the result. But when i try to do it i got code printed on the page after clicking on submit button.
my HTML code is below
CALCULATOREnter Your Desired Values
Number 1:
Number 2:
+ - x /and the PHP code is.
<?php $num1 = $_POST['num1']; $num2 = $_POST['num2']; $operation = $_POST['operation']; if($operation === '+'){ $result = $num1 + $num2; echo $result; } if($operation === '-'){ $result = $num1 - $num2; echo $result; } if($operation === 'x'){ $result = $num1 * $num2; echo $result; } if($operation === '/'){ $result = $num1 / $num2; echo $result; } ?>i dont know why its not working but my xampp is working fine. Plz help