l105/PO Informatica P4/po informatica/inlog.php

<?php $username = $_POST['username']; $password = $_POST['password']; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>inloggen</title> </head> <body> <?php include('navbar.php'); ?> <form method='post' action =''> <div>Grebuikersnaam <input type='text' name='username' value=""></div> <div>Wachtwoord <input type='password' name='password' value=""></div> <div><input type='submit' value='inloggen'></div> </form> <?php include("functies.php"); include("db.php"); if(isset($username) && isset($password)) { if($username == "grimme" && $password == "grimme") { echo "Je bent ingelogt"; setcookie('admin', true, time() +60*60*24); } else { echo "De inloggegevens kloppen niet"; } } ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse