-
Notifications
You must be signed in to change notification settings - Fork 3
/
verify.php
31 lines (25 loc) · 975 Bytes
/
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
31
<?php
$con=mysqli_connect("localhost","digibd_docket","docket","digibd_docket");
//$con=mysqli_connect("localhost","root","","docket");
if($con===false)
{
echo '<script type= "text/javascript"> alert ("Database Could not connect")</script>';
}
$token = $_GET['token'];
$sql ="SELECT * FROM UserInfo WHERE token = '$token' AND verified = 'no' ";
$query_run = mysqli_query($con,$sql);
if(mysqli_num_rows($query_run) > 0) {
// echo '<script type="text/javascript"> alert("Email Already in USE. Use a different email.")</script>';
$query = "UPDATE UserInfo SET verified ='yes' WHERE token = '$token' ";
if(mysqli_query($con,$query)){
echo "<script> location.href='SignIn.php'; </script>";
}
else
{
echo '<script type="text/javascript"> alert("Something went wrong.")</script>';
}
}
else {
echo '<script type="text/javascript"> alert("Invalid Token. Sign Up again.")</script>';
}
?>