From 5aa65fed125a9f0f471660a78a2fae344c5f717d Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Tue, 7 May 2024 19:28:58 +0200 Subject: [PATCH] created code for user registering --- index.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/index.php b/index.php index 3137dbe..91aabd1 100644 --- a/index.php +++ b/index.php @@ -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"; + } } ?>