View sourcecode

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

m03u01.2.php

41 lines UTF-8 Unix (LF)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>

  <!-- Milligram CSS -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.1/milligram.min.css">

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <?php 
$lösenord 
=["Johan"=> "hemlig",
                    
"Ester"=> "välkommen"];
                
            

if (
$lösenord[$_POST['username']]== $_POST["password"]){
    echo 
"<p>Du har skrivit rätt lösenord</p>";
}else {
    echo 
"<p>Felaktigt lösenord!</p>";
}

    echo 
"<pre>";
    
print_r($_POST);
    echo 
"</prev>";


echo 
"Välkommen {$_POST['username']}";

if (isset(
$_POST["confirm"])){
    echo 
"<p> Du har godkänt Villkoren </p>";
}else{
    echo 
"<p>Du är sämst";
}
    
?>
</body>
</html>