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"; + } } ?>