Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. --------------------------------------------
  2. <?php
  3.  
  4. $a = $_POST['a'];
  5. $b = $_POST['b'];
  6. $iloczyn=$a*$b;
  7. $suma=$a+$b;
  8. $iloraz=$a/$b;
  9. $roznica=$a-$b;
  10.  
  11. echo "A : $a";
  12. echo "<br>";
  13. echo "B: $b";
  14. echo "<br>";
  15. echo "wynik dodawania : $suma";
  16. echo "<br>";
  17. echo "wynik odejmowania : $roznica";
  18. echo "<br>";
  19. echo "wynik mnozenia : $iloczyn";
  20. echo "<br>";
  21. if($b==0){
  22. echo "Nie dzielimy przez 0";
  23. }else{
  24. echo "wynik dzielenia: $iloraz";
  25. }
  26. ?>
  27.  
  28. --------------------------------------------
  29. <!doctype html>
  30. <html>
  31. <head>
  32. <title>Przyciski</title>
  33. <meta charset="utf-8" />
  34. <link rel="stylesheet" type="text/css" href="style.css" />
  35. </head>
  36. <body>
  37.  
  38. <form action="nowy.php" method="post">
  39. <fieldset>
  40.  
  41. <label>Podaj liczbe A </label> <input type="number" name="a" maxlength="30" size="30"><br><br>
  42. <label> Podaj liczbe B </label> <input type="number" name="b" maxlength="30" size="30" ><br><br>
  43. <input type="submit" value="Podziel">
  44.  
  45. </fieldset>
  46. </form>
  47.  
  48. </body>
  49. </html>
  50. --------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement