updated git ignore and created email confirmation page
This commit is contained in:
parent
d9d2fb682b
commit
ebc0007069
2 changed files with 30 additions and 1 deletions
4
hotel_booking/.gitignore
vendored
4
hotel_booking/.gitignore
vendored
|
@ -1,3 +1,5 @@
|
||||||
images/*
|
images/*
|
||||||
admin/components/db_config.php
|
admin/components/db_config.php
|
||||||
admin/components/api.php
|
admin/components/api.php
|
||||||
|
ajax/login_register.php
|
||||||
|
components/sendgrid/*
|
27
hotel_booking/email_confirm.php
Normal file
27
hotel_booking/email_confirm.php
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
require('admin/components/utils.php');
|
||||||
|
require('admin/components/db_config.php');
|
||||||
|
|
||||||
|
if(isset($_GET['email_confirmation'])){
|
||||||
|
$data = filteration($_GET);
|
||||||
|
$query = select("SELECT * FROM `user_creds` WHERE `email`=? AND `token`=? LIMIT 1", [$data['email'], $data['token']], 'ss');
|
||||||
|
|
||||||
|
if(mysqli_num_rows($query) == 1){
|
||||||
|
$fetch = mysqli_fetch_assoc($query);
|
||||||
|
if($fetch['is_verified'] == 1){
|
||||||
|
echo "<script>alert('Your email is already verified.')</script>";
|
||||||
|
} else{
|
||||||
|
$update = update("UPDATE `user_creds` SET `is_verified`=? WHERE `id`=?", [1, $fetch['id']], 'ii');
|
||||||
|
if($update){
|
||||||
|
echo "<script>alert('Your email was successfully verified.')</script>";
|
||||||
|
} else{
|
||||||
|
echo "<script>alert('Fail to verify your email')</script>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
redirect('index.php');
|
||||||
|
} else{
|
||||||
|
echo "<script>alert('Invalid link!')</script>";
|
||||||
|
redirect('index.php');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Add table
Reference in a new issue