Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- if(isset( $_GET["num1"])||isset( $_GET["num2"]))
- {
- if( $_GET["num1"] || $_GET["num2"] ) {
- echo "number 1 is ". $_GET['num1']. "<br /><br />";
- echo "number 2 is ". $_GET['num2']. "<br/>";
- $sum = $_GET["num1"] + $_GET["num2"];
- $pro = $_GET["num1"] * $_GET["num2"];
- $diff = $_GET["num1"] - $_GET["num2"];
- echo "the sum of two numbers is". $sum."<br/><br/>";
- echo "the prod of two numbers is". $pro."<br/><br/>";
- echo "the diff of two numbers is". $diff;
- exit();
- }
- }
- ?>
- <html>
- <body>
- <form action = "<?php $_PHP_SELF ?>" method = "GET">
- enter first number : <input type = "text" name = "num1" /><br/><br/>
- enter second number : <input type = "text" name = "num2" /><br/>
- <input type = "submit" name ="submit" value ="click me"/>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement