-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemail_confirm.php
35 lines (31 loc) · 1.09 KB
/
email_confirm.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require('./admin/db_config.php');
require('./admin/essentials.php');
if(isset($_GET['email_confirmation']))
{
$data = filteration($_GET);
$query = select("SELECT * FROM `user_cred` 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('Email already verified!')</script>";
}
else{
$update = update("UPDATE `user_cred` SET `is_verified`=? WHERE `id`=?",[1,$fetch['id']],'ii');
if($update){
echo"<script>alert('Email verification successful!')</script>";
}
else{
echo"<script>alert('Email verification failed!')</script>";
}
}
redirect('./index.php');
}
else{
echo"<script>alert('Invalid Link!')</script>";
redirect('./index.php');
}
}
?>