-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathverify.php
30 lines (30 loc) · 1.05 KB
/
verify.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
<?php
include 'partials/_dbconnect.php';
if(isset($_GET['email'])&& isset($_GET['v_code'])){
$query = "SELECT * FROM `users` WHERE `user_email`='$_GET[email]' AND `verification_code`='$_GET[v_code]'";
$result = mysqli_query($conn,$query);
if($result){
if(mysqli_num_rows($result) == 1){
$result_fetch = mysqli_fetch_assoc($result);
if($result_fetch['is_verified'] == 0){
$update = "UPDATE `users` SET `is_verified`='1' WHERE `user_email`='$_GET[email]'";
if(mysqli_query($conn,$update)){
echo "
<script>
alert('Email verification successful!!');
window.location.href='index.php';
</script>
";
}else{
echo "
<script>
alert('can not run your query');
window.location.href='index.php';
</script>
";
}
}
}
}
}
?>