fork download
  1. // Multiplication and Division of two numbers
  2. <html>
  3. <head>
  4. <title>PHP Program To calculate Multiplication and Division of two numbers</title>
  5. </head>
  6. <body>
  7. <form method="post">
  8. <table border="0">
  9. <tr>
  10. <td><input type="text" name="num1" value="" placeholder="Enter a value"/></td>
  11. </tr>
  12. <tr>
  13. <td><input type="text" name="num2" value="" placeholder="Enter b value"/></td>
  14. </tr>
  15. <tr>
  16. <td><input type="submit" name="submit" value="Submit"/></td>
  17. </tr>
  18. </table>
  19. </form>
  20.  
  21. <?php
  22. if(isset($_POST['submit']))
  23. {
  24. $a = $_POST['num1'];
  25. $b = $_POST['num2'];
  26. $mul = $a * $b; // Multiplication of two numbers
  27. $div = $a/$b; // Division of two numbers
  28. echo "Multiplication of two numbers : $a * $b = ".$mul;
  29. echo "Division of two numbers : $a / $b = ".$div;
  30. }
  31. ?>
  32. </body>
  33. </html
Success #stdin #stdout 0.02s 25712KB
stdin
45
stdout
// Multiplication and Division of two numbers
<html>
<head>
<title>PHP Program To calculate Multiplication and Division of two numbers</title>
</head>
<body>
<form method="post">
<table border="0">
<tr>
<td><input type="text" name="num1" value="" placeholder="Enter a value"/></td>
</tr>
<tr>
<td><input type="text" name="num2" value="" placeholder="Enter b value"/></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Submit"/></td>
</tr>
</table>
</form>

</body>
</html