Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <?php
- $_SESSION['num1']=$_POST['num1'];
- $_SESSION['num2']=$_POST['num2'];
- $_SESSION['Operator']=$_POST['Operator'];
- $x= $_SESSION['num1'];
- $y= $_SESSION['num2'];
- $z= $_SESSION['Operator'];
- ?>
- </head>
- <body>
- <?php echo $x; ?>
- <?php echo $y; ?>
- <?php if ($z = 'add')
- $w = $x + $y;
- else if ($z = 'subtract')
- $w = $x - $y;
- else if ($z = 'times')
- $w = $x * $y;
- else if ($z = 'divide')
- $w = $x / $y;
- else {
- $w = 'undefined';}
- echo $w;
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement