Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/ovning7/

dininloggningssida.php
index.html
ovn_cook1.php
ovn_cook2.php
ovn_cook3.php
ovn_cook4.php
ovn_cook5.php

ovn_cook1.php

24 lines UTF-8 Windows (CRLF)
    <?php
        $cookie_name 
"appeared";
        
$cookie_value "true";
        
setcookie($cookie_name$cookie_valuetime() + (60*60), "/");
    
?>
<!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
    
if (!isset($_COOKIE[$cookie_name])) {
        echo 
"Välkommen!";
    } else {
        echo 
"Välkommen Tillbaka";
    }
    
?>
</body>

</html>