Advertisement
Guest User

Untitled

a guest
Nov 14th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <?php
  5. $_SESSION['num1']=$_POST['num1'];
  6. $_SESSION['num2']=$_POST['num2'];
  7. $_SESSION['Operator']=$_POST['Operator'];
  8.  
  9.  
  10. $x= $_SESSION['num1'];
  11. $y= $_SESSION['num2'];
  12. $z= $_SESSION['Operator'];
  13. ?>
  14. </head>
  15. <body>
  16.  
  17.  
  18. <?php echo $x; ?>
  19.  
  20. <?php echo $y; ?>
  21.  
  22. <?php if ($z = 'add')
  23. $w = $x + $y;
  24. else if ($z = 'subtract')
  25. $w = $x - $y;
  26. else if ($z = 'times')
  27. $w = $x * $y;
  28. else if ($z = 'divide')
  29. $w = $x / $y;
  30. else {
  31. $w = 'undefined';}
  32. echo $w;
  33.  
  34. ?>
  35. </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement