Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2. $site = $_GET["seite"];
  3. $inhalt = $_GET["inhalt"];
  4.  
  5. if (!isset($site))
  6.     {
  7.     $site="index";
  8.     }
  9.  
  10.     if ($site=="index")
  11.         {  
  12.         echo '<form action="?seite=berechnen" method="POST">
  13.         Zahl: <input type="text" name="zahl"><br />
  14.         <input type="submit" value="Berechnen!"></form>';
  15.         }
  16.  
  17. $zahl = $_POST["zahl"];
  18. $counter = 0;
  19.  
  20.     if ($site=="berechnen")
  21.     {
  22.         if($zahl > 25)
  23.         {
  24.         $zahl = 25;
  25.         }
  26.  
  27.         while($counter < $zahl)
  28.         {
  29.         $counter++;
  30.         echo $counter.", ";
  31.         }
  32.     }
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement