From daba18d1d001296a81e8502b0f479f010530def5 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Wed, 19 Feb 2020 16:10:06 +0100 Subject: [PATCH] started implementation of signup --- threadr/signup/index.html | 2 +- threadr/signup/redirect.php | 51 +++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/threadr/signup/index.html b/threadr/signup/index.html index b04d583..e6a8e54 100644 --- a/threadr/signup/index.html +++ b/threadr/signup/index.html @@ -23,7 +23,7 @@

Sign Up:

-

Benutzername:

+

Benutzername:

E-Mail:

Passwort:

Passwort bestätigen:

diff --git a/threadr/signup/redirect.php b/threadr/signup/redirect.php index e69de29..adbd8cf 100644 --- a/threadr/signup/redirect.php +++ b/threadr/signup/redirect.php @@ -0,0 +1,51 @@ +prepare('INSERT INTO users (name, authentication_string, authentication_salt, authentication_algorithm) VALUES (:name, :authentication_string, :authentication_salt, :authentication_algorithm)'); + $result = $statement->execute(array('name' => $_POST['name'], 'authentication_string' => hash($password_hash_method, $_POST['password'] . $random_salt), 'authentication_salt' => $random_salt, 'authentication_algorithm' => $password_hash_method)); + if (!$result) { + $error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2]; + } + } + //You know, just in case... (To be removed after proper error handling is in place) + echo $error_message; +?> +
+ +