Add any two numbers using PHP

<html>
<body>
<form method="POST">
Number 1:<br>
<input name="num1"><br>
Number 2:<br>
<input name="num2"><br>
<input type="submit" name="submit">
</form>
<?php
if(isset($_POST['submit']))
{
$a=$_POST['num1'];
$b=$_POST['num2'];
$c=$a+$b;
echo "Sum : ",$c;
}
?>
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *