00001 <?php 00012 //This is to include file common_functions.php which has 00013 //common functions which are required in more than one page. 00014 require("common_functions.php"); 00015 00016 00026 function main() 00027 { 00028 //Here we are checking whether form was submitted or not by looking 00029 //at value of submit1 (name of submit button). If form is submitted 00030 //using given button it would be set and value would be equal to 00031 //'Add' (what is displayed on button) 00032 if(isset($_GET['submit1'])) 00033 { 00034 $num1=check_and_get('num1'); 00035 $num2=check_and_get('num2'); 00036 echo "Sum of $num1 and $num2 is " . ($num1 + $num2) . "<br/>\n"; 00037 } 00038 else 00039 display_add_form("add2.php", ""); 00040 } 00041 00042 00043 main(); 00044 00045 ?>