iwa-panda1

Manage Weather Data by International Weather Agency (Version 1)
Log | Files | Refs

commit c1ad5790881fde73dd7d6d1e653a67436f04f86e
parent 7e00efafb8a3bed0fc3f7dc83e6ae4495b811194
Author: Gerco van Woudenbergh <[email protected]>
Date:   Tue, 21 Mar 2023 12:45:06 +0100

password hashing en placeholder aangepast

Diffstat:
Mcrud_user.php | 4++--
Mform.html | 53++++++++++++++++++++++++++---------------------------
2 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/crud_user.php b/crud_user.php @@ -18,11 +18,11 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $password = $_POST['password']; $permissions = $_POST['permissions']; } - +$hash = password_hash($password, PASSWORD_DEFAULT); $sql = "INSERT INTO medewerkers (voornaam, achternaam, email, wachtwoord, permissie_niveau) VALUES(?, ?, ?, ?, ?);"; $stmt= $conn->prepare($sql); -$stmt->bind_param("sssss", $vname, $aname, $email, $password, $permissions); +$stmt->bind_param("sssss", $vname, $aname, $email, $hash, $permissions); $stmt->execute(); mysqli_close($conn); diff --git a/form.html b/form.html @@ -1,33 +1,32 @@ <html lang="nl"> -<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>User toevoegen</title> -</head> -<body> + <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>User toevoegen</title> + </head> + <body> -<h1>User toevoegen</h1> + <h1>User toevoegen</h1> -<form action="crud_user.php" method="post"> - <p> - <b>Voornaam:</b> <input type="text" name="voornaam" id="voornaam" placeholder="Voornaam"> - <b>Achternaam:</b> <input type="text" name="achternaam" id="achternaam" placeholder="Email"> - <b>Email</b> <input type="text" name="email" id="email" placeholder="Email"> - <b>Wachtwoord</b> <input type="password" name="password" id="password" placeholder="******"> - <br> - <p>Please select the user permissions:</p> - <input type="radio" id="Admin" name="permissions" value="1"> - <label for="html">Admin</label><br> - <input type="radio" id="Administratief medewerker" name="permissions" value="2"> - <label for="Administratief medewerker">Administratief medewerker</label><br> - <input type="radio" id="Wetenschappelijk medewerker" name="permissions" value="3"> - <label for="Wetenschappelijk medewerker">Wetenschappelijk medewerker</label> - </p> + <form action="crud_user.php" method="post"> + <p> + <b>Voornaam:</b> <input type="text" name="voornaam" id="voornaam" placeholder="Voornaam"> + <b>Achternaam:</b> <input type="text" name="achternaam" id="achternaam" placeholder="Achternaam"> + <b>Email</b> <input type="text" name="email" id="email" placeholder="Email"> + <b>Wachtwoord</b> <input type="password" name="password" id="password" placeholder="******"> + <br> + <p>Please select the user permissions:</p> + <input type="radio" id="Admin" name="permissions" value="1"> + <label for="html">Admin</label><br> + <input type="radio" id="Administratief medewerker" name="permissions" value="2"> + <label for="Administratief medewerker">Administratief medewerker</label><br> + <input type="radio" id="Wetenschappelijk medewerker" name="permissions" value="3"> + <label for="Wetenschappelijk medewerker">Wetenschappelijk medewerker</label> + </p> - <p><input type="submit" name="submit" value="Voeg toe"></p> + <p><input type="submit" name="submit" value="Voeg toe"></p> -</form> - -</body> + </form> + </body> </html>