Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/

index.php
ovn1_gr.php
ovn2_fn.php
ovn3_inkl.php
ovn3_inklfil.php
ovn3_inklfil2.php
ovn3_inklsida1.php
ovn3_inklsida2.php
ovn3_inklsida3.php
ovn3_inklsidafil.php
ovn4_form.php
ovn4_mottagare.php
ovn4_mottagare2.php
ovn4_mottagare3.php
ovn4_mottagare4.php
quiz.php

ovn4_mottagare4.php

25 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>Document</title>
</head>

<body>
    <?php
    $tal1 
= $_POST["tal1"];
    
$tal2 = $_POST["tal2"];
    
$tal3 = $_POST["tal3"];

    function 
medel(int $tal1, int $tal2, int $tal3){
        
$medel = ($tal1 + $tal2 + $tal3)/3;
        return 
$medel;
    };
    echo 
"Tal: " . $tal1 . ", " . $tal2 . ", " . $tal3 . "<br>Medelvärde: " . medel($tal1, $tal2, $tal3);
    
?>

</body>

</html>