summaryrefslogtreecommitdiff
path: root/signup
diff options
context:
space:
mode:
Diffstat (limited to 'signup')
-rwxr-xr-xsignup/signup.php5
-rwxr-xr-xsignup/verify/verify.php9
2 files changed, 8 insertions, 6 deletions
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) {