Advertisement
Guest User

Calc PHP

a guest
Apr 23rd, 2014
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2.  
  3. <html>
  4. <head>
  5. <title>Calculator</title>
  6. <meta charset="utf-8" />
  7. <link href="style.css" rel="stylesheet" type="text/css">
  8. </head>
  9.  
  10. <body>
  11.  
  12. <div id="wrapper">
  13.  
  14. <h3>Calculator</h3>
  15.  
  16. <?
  17. $num1 = $_POST['num1'];
  18. $num2 = $_POST['num2'];
  19.  
  20. {
  21. if(isset($_POST['+']));
  22. echo "The total is:"($num1 + $num2)
  23.  
  24. elseif(isset($_POST['-']));
  25. echo "The total is:"($num1 - $num2)
  26.  
  27. elseif(isset($_POST['*']));
  28. echo "The total is:"($num1 * $num2)
  29.  
  30. elseif(isset($_POST['/']));
  31. echo "The total is:"($num1 / $num2)
  32. }
  33. ?>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement