created code for user registering

This commit is contained in:
Václav Šmejkal 2024-05-07 19:28:58 +02:00
parent 55b34c5070
commit 5aa65fed12
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -47,6 +47,15 @@
if (isset($_POST["sub"]))
{
if (str_starts_with($_POST["sub"], "Registrovat"))
{
$safe_uname = mysqli_real_escape_string($database, $_POST["username"]);
$database -> query("INSERT INTO user (username, password) VALUES (\"" . $safe_uname . "\",\"" . hash("sha256", $_POST["password"]) ."\")");
} else
{
echo "log";
}
}
?>
</body>