Facebook
From Capacious Motmot, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 265
  1. <!DOCTYPE HTML>
  2. <html lang="pl">
  3.         <head>
  4.                 <meta charset="utf-8"/>
  5.         </head>
  6.         <body>
  7.         Zad 4 <br>
  8.         <form action="funkcje.php" method="post">
  9.     Podaj liczbe: <input type="text" name="liczba" />
  10.     <input type="submit" name="submit" value="PRZEKAZ" />
  11.         </form><br>
  12.         WYNIK: <br>
  13.         <?php
  14.             $n=$_POST['liczba'];
  15.                 $wynik = 1;
  16.                 for ($i=1;$i<$n+1;$i++){
  17.                         echo "$i *";
  18.                         $wynik=$wynik*$i;
  19.                 }
  20.                 echo "= $wynik";
  21.         ?>
  22. </body>
  23. </html>