Show sourcecode

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

webbsrvprg1/exercises/ovning7/uppgift2/

index.php

index.php

23 lines UTF-8 Windows (CRLF)
<?php
    session_start
();
?>


<html>
<body>
    <?php
    
if (isset($_SESSION["first"])) {
        
$skillnad = time() - $_SESSION["first"];
        
        if (
$skillnad <= 10) {
            echo 
"<h1>Välkommen tillbaka!</h1>";
        } else {
            echo 
"<h1>Välkommen!</h1>";
        }
    } else {
        echo 
"<h1>Välkommen!</h1>";
    }
    
$_SESSION["first"] = time();
    
?>
</body>
</html>