daily pastebin goal
82%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title> Proste działania </title>
  5. </head>
  6. <body>
  7. <?php
  8.  
  9. function fdodawanie(){
  10. $x=trim($_POST['x']);  
  11. $y=trim($_POST['y']);
  12. echo $x+$y;}
  13. function fodejmowanie(){
  14. $x=trim($_POST['x']);  
  15. $y=trim($_POST['y']);
  16. echo $x-$y;}
  17. function fmnozenie(){
  18. $x=trim($_POST['x']);  
  19. $y=trim($_POST['y']);
  20. echo $x*$y;}
  21. function fdzielenie(){
  22. $x=trim($_POST['x']);  
  23. $y=trim($_POST['y']);
  24. echo $x/$y;}
  25.  
  26. if(isset($_POST['dodawanie'])){
  27. fdodawanie();  
  28. }
  29. if(isset($_POST['odejmowanie'])){
  30. fodejmowanie();
  31. }
  32. if(isset($_POST['mnożenie'])){
  33. fmnozenie();   
  34. }
  35. if(isset($_POST['dzielenie'])){
  36. fdzielenie();  
  37. }
  38. ?>
  39. <form action="" method="post">
  40. <input type="number" name="x"><br />   
  41. <input type="number" name="y"><br />
  42. <input type="submit" name="dodawanie" value="dodawanie">
  43. <input type="submit" name="odejmowanie" value="odejmowanie"><br />
  44. <input type="submit" name="mnożenie" value="mnożenie">
  45. <input type="submit" name="dzielenie" value="dzielenie">
  46.    
  47. </form>
  48. </body>
  49. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top