Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8">
- <title> Proste działania </title>
- </head>
- <body>
- <?php
- function fdodawanie(){
- $x=trim($_POST['x']);
- $y=trim($_POST['y']);
- echo $x+$y;}
- function fodejmowanie(){
- $x=trim($_POST['x']);
- $y=trim($_POST['y']);
- echo $x-$y;}
- function fmnozenie(){
- $x=trim($_POST['x']);
- $y=trim($_POST['y']);
- echo $x*$y;}
- function fdzielenie(){
- $x=trim($_POST['x']);
- $y=trim($_POST['y']);
- echo $x/$y;}
- if(isset($_POST['dodawanie'])){
- fdodawanie();
- }
- if(isset($_POST['odejmowanie'])){
- fodejmowanie();
- }
- if(isset($_POST['mnożenie'])){
- fmnozenie();
- }
- if(isset($_POST['dzielenie'])){
- fdzielenie();
- }
- ?>
- <form action="" method="post">
- <input type="number" name="x"><br />
- <input type="number" name="y"><br />
- <input type="submit" name="dodawanie" value="dodawanie">
- <input type="submit" name="odejmowanie" value="odejmowanie"><br />
- <input type="submit" name="mnożenie" value="mnożenie">
- <input type="submit" name="dzielenie" value="dzielenie">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement