Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbsrvprg/exercises/repetition/

hemligheter.php
repetition.php
repetition1.php
repetition2.php
repetition3.php
repetition3_medel.php
repetition4.php
repetition5.php
repetition6.php
repetition7.php
repetition8.php

repetition3.php

31 lines UTF-8 Windows (CRLF)
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Repetition</title>
</head>
<body>
  <?php
  
include "repetition3_medel.php";

  if (isset(
$_GET["bob"])) {
    
$a = [];
    for (
$i 0$i $_GET["bob"]; $i++) {
      
$a[$i] = rand(1,100);
      echo 
"$a[$i]<br>";
    }
    
    
medel($a);
  }
  
?>

  <form method="GET" action="">
    <label for="amount">Hur många tal ska slumpas ut?</label>
    <br>
    <input type="number" id="amount" name="bob">

    <input type="submit" value="Beräkna">
  </form>
</body>
</html>