The soulution to your problem is as follows:
<html>
<head>
<title>question2</title>
<head>
<body>
if(isset($_POST['num1'])){
$num1 = $_POST['num1'];
$num2 = $_POST['num2'];
$result = $num1 + $num2;
}
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" name="myform" align="center">
Enter number 1:<input type="text" name="num1" />
<br />
Enter number 2:<input type="text" name="num2" />
<br />
<input type="submit" name="result" />
</form>
<hr />
<table border="1" align="left">
<tr><td align="center">number 1</td><td align="center">calculate</td><td align="center">number 2</td><td align="center">result</td></tr>
<tr><td align="center"></td><td align="center">+</td><td align="center"></td><td align="center"></td></tr>
</table>
<?php } ??>
</head></head></html>
Have fun!!!