Sum Of Two Number



<?php 

if($_POST["b1"])
    {
    $val1 = $_POST["t1"];
    $val2 = $_POST["t2"];
   
    $sum = $val1 + $val2;
   
    echo "Value is $sum <br>";
    }
 ?>


<html>
    <body>
        <form action="lec1.php" method="post">
            <table border="5">
                <tr>
                    <td>Enter first number :</td>
                    <td><input type="text" name="t1"/></td>
                </tr>
               
                <tr>
                    <td>Enter second number :</td>
                    <td><input type="text" name="t2"/></td>
                </tr>
               
                <tr>
                    <td colspan="2"><input type="submit" name="b1" value="Sum"/>
                    </td>
                       
                </tr>
            </table>
        </form>
    </body>
</html>

Sum Of Two Number Sum Of Two Number Reviewed by Baljeet Singh on 11:02 Rating: 5

No comments:

Powered by Blogger.