Show sourcecode
The following files exists in this folder. Click to view.
webbsrvprg/exercises/cookie-session/
ovn_cook1.php
ovn_cook2.php
ovn_cook3.php
ovn_cook3hem.php
ovn_cook4.php
ovn_cook5.php
ovn_cook3.php
38 lines UTF-8 Windows (CRLF)
<?php
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST["användarnamn"])) {
$_SESSION["användarnamn"] = $_POST["användarnamn"];
}
if (isset($_POST["lösenord"])) {
$_SESSION["lösenord"] = $_POST["lösenord"];
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cookie-Session 3</title>
</head>
<body>
<form action="" method="post">
Användarnamn <br>
<input type="text" name="användarnamn" required><br> <br>
Lösnord <br>
<input type="text" name="lösenord" required > <br><br>
<input type="submit">
</form>
<a href="ovn_cook3hem.php">Hämligheter</a>
<?php
?>
</body>
</html>