-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.php
More file actions
55 lines (49 loc) · 1.62 KB
/
verify.php
File metadata and controls
55 lines (49 loc) · 1.62 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require("dbcon.php");
if(isset($_GET['email']) && isset($_GET['v_code'])){
$email = $_GET['email'];
$v_code = $_GET['v_code'];
$query =" SELECT * FROM tbl_student WHERE email='$email' AND verification_code = '$v_code'";
$result = mysqli_query($con, $query);
if($result){
if(mysqli_num_rows($result)==1){
$result_fetch = mysqli_fetch_assoc($result);
if($result_fetch['is_verified']==0){
$update = "UPDATE tbl_student SET `is_verified`='1' WHERE email='$result_fetch[email]'";
if(mysqli_query($con,$update)){
echo "
<script>
alert('Email Verification successfull and Hostel Request Successfull');
window.location.href='index.php';
</script>
";
}
else{
echo "
<script>
alert('Can not run Query1');
window.location.href='index.php';
</script>
";
}
}
else{
echo "
<script>
alert('Email Already Verified');
window.location.href='index.php';
</script>
";
}
}
}
else{
echo "
<script>
alert('can not run query2');
window.location.href='index.php';
</script>
";
}
}
?>