Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------
- <?php
- $a = $_POST['a'];
- $b = $_POST['b'];
- $iloczyn=$a*$b;
- $suma=$a+$b;
- $iloraz=$a/$b;
- $roznica=$a-$b;
- echo "A : $a";
- echo "<br>";
- echo "B: $b";
- echo "<br>";
- echo "wynik dodawania : $suma";
- echo "<br>";
- echo "wynik odejmowania : $roznica";
- echo "<br>";
- echo "wynik mnozenia : $iloczyn";
- echo "<br>";
- if($b==0){
- echo "Nie dzielimy przez 0";
- }else{
- echo "wynik dzielenia: $iloraz";
- }
- ?>
- --------------------------------------------
- <!doctype html>
- <html>
- <head>
- <title>Przyciski</title>
- <meta charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="style.css" />
- </head>
- <body>
- <form action="nowy.php" method="post">
- <fieldset>
- <label>Podaj liczbe A </label> <input type="number" name="a" maxlength="30" size="30"><br><br>
- <label> Podaj liczbe B </label> <input type="number" name="b" maxlength="30" size="30" ><br><br>
- <input type="submit" value="Podziel">
- </fieldset>
- </form>
- </body>
- </html>
- --------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement