'Email Verification using PHP- Status Changes by opening an email rather than clicking on link
Email verification status changes from "non-verified" to "Verified" by opening verification email rather than clicking on the verification link. Kindly identify the issue
Here is my code:
session_start();
include('header.php');
include('admin/includes/connection.php');
$msg="";
$emailis=$_GET['email'];
$codis =$_GET['v_code'];
if(isset($_GET['email']) && isset($_GET['v_code'])) {
$query="select * from users where email='$_GET[email]' and v_code='$_GET[v_code]'";
$result=mysqli_query($con,$query);
if($result)
{
if(mysqli_num_rows($result)==1)
{
$row = mysqli_fetch_array($result);
if($row['status']==0)
{
$update="update users set status=1 where email='$emailis' and v_code='$codis'";
if(mysqli_query($con,$update))
{
$msg="Account has been verified.";
}
else
{
$msg ="Some issue in running query";
}
}
else
{
$msg="Username is already verified";
}
}
else
{
$msg="Zero Record";
}
}
else
{
$msg="Cannot run query";
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
