hip1/11.9/11.9.php

<!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 $username = $_POST['username']; $password = $_POST['password']; if($username === "degoedegebruikersnaam"){ setcookie('username', $_COOKIE['username'] = $username); } else{ $_COOKIE['username'] = ''; } if($password === "hetjuistewachtwoord") { setcookie('password', $_COOKIE['password'] = $password); } else{ $_COOKIE['password'] = ''; } if($_COOKIE['username']){ if($_COOKIE['password']){ echo "You got both right, so cool"; } else{ echo "You got the password wrong, halfway there"; } } else{ if($_COOKIE['password']){ echo "You got the password right but not the username. Telling you this makes no sense"; } else{ echo "You got both the username and password wrong, keep at it"; } } ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse