From 1b35cf3f1124b161ebde5e9e3a2c74c8ea2821d0 Mon Sep 17 00:00:00 2001 From: Connor Thomson Date: Sun, 20 Sep 2026 21:01:48 -0700 Subject: Add status and more --- signup/signup.php | 5 +++-- signup/verify/verify.php | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'signup') diff --git a/signup/signup.php b/signup/signup.php index a41454a..7648adf 100755 --- a/signup/signup.php +++ b/signup/signup.php @@ -39,13 +39,14 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $code = rand(1000, 9999); try { - $sql = "INSERT INTO users (username, email, password, verification_code) VALUES (:username, :email, :password, :code)"; + $sql = "INSERT INTO users (username, email, password, verification_code, status) VALUES (:username, :email, :password, :code, :status)"; $user_id = insert_row($sql, [ 'username' => $username, 'email' => $email, 'password' => $hashed_password, - 'code' => $code + 'code' => $code, + 'status' => 'none' ]); set_user_id($user_id); diff --git a/signup/verify/verify.php b/signup/verify/verify.php index 592915f..9e22132 100755 --- a/signup/verify/verify.php +++ b/signup/verify/verify.php @@ -47,7 +47,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { exit; } - if ($real_code == '0001') { + if ($user['status'] == 'none') { echo "Account is already verifed"; exit; } @@ -58,11 +58,12 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { } try { - $sql = "UPDATE users SET verification_code = :code WHERE id = :id"; + $sql = "UPDATE users SET verification_code = :code, status = :status WHERE id = :id"; $statement = query($sql, [ - 'code' => '0001', - 'id' => $user_id + 'code' => '0000', + 'status' => 'member', + 'id' => $user_id ]); if ($statement->rowCount() == 0) { -- cgit v1.2.3