Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="UTF-8">
- </head>
- <body>
- <form method="GET" action="ptest.php">
- <p> a:<input type="text" name="a"> b:<input type="text" name="b"> c:<input type="text" name="c"></p>
- <p><input type="submit" name="iloczyn" value="iloczyn"></p>
- <p><input type="submit" name="max" value="max"></p>
- <p><input type="submit" name="suma" value="suma"></p>
- <p><input type="submit" name="silnia" value="silnia"></p>
- </form>
- </body>
- <html>
- ----------------------PHP-------------------------
- <html>
- <body>
- PHP
- <br/><br/>
- <?php
- $a=($_GET['a']);
- $b=($_GET['b']);
- $c=($_GET['c']);
- if($a>$b && $a>$c)//iloczyn i max
- {
- $il=$b*$c;
- $max=$a;
- }
- if($b>$a && $b>$c)
- {
- $il=$a*$c;
- $max=$b;
- }
- if($c>$b && $c>$a)
- {
- $il=$b*$a;
- $max=$c;
- }
- $sum=0;//suma
- if($a%2==0)
- $sum+=$a;
- if($b%2==0)
- $sum+=$b;
- if($c%2==0)
- $sum+=$b;
- $sil=1;//silnia
- for($i=1; $i<=$a; $i++)
- $sil*=$i;
- echo "iloczyn: ".$il."<br/>";
- echo "max: ".$max."<br/>";
- echo "suma: ".$sum."<br/>";
- echo "silnia: ".$sil."<br/>";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement