Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/repetition/

include1.php
index.php
ovn_rep1 copy.php
ovn_rep1.php
ovn_rep2.php
ovn_rep3.php
ovn_rep5.php

ovn_rep3.php

36 lines ASCII Windows (CRLF)
<?php
error_reporting
(-1); // Report all type of errors
ini_set('display_errors'1); // Display all errors
ini_set('output_buffering'0); // Do not buffer outputs, write directly
?>

<!DOCTYPE html>
<html lang="sv">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>REPETITION</title>
</head>

<body>
    <?php
    
include("include1.php");
    if (isset(
$_GET["count"])){
        
$arr = [];
        for(
$i=0;$i<$_GET["count"];$i++){
            
$arr[] = random_int(0,100000);
        }
        
$mean get_mean($arr);
        
var_dump($arr);
        echo(
"<br>" $mean);
    }
    
?>
    <form method="get">
        <input type="number" name="count" id="count" required> <label for="count">Skriv in ett tal</label>
        <button type="submit">Skicka in</button>
        <br><br><br><br><br>
    </form>
</body>

</html>