File: /var/www/nclive/backend/verify_email_status.php
<?php
header("Access-Control-Allow-Origin: *");
header('Content-Type: application/json');
include "config.php";
// error_reporting(E_ALL);
// ini_set('display_errors',1);
// ini_set('display_startup_errors',1);
$refr = $_SERVER['HTTP_REFERER'];
if($refr!='')
{
$json = file_get_contents('php://input');
$data = json_decode($json);
$email = $data->email;
$curDate = date('y-m-d h:i:s');
$checkExistQuery = "select count(id) as total from sp_subscription where email_id='$email'";
$sqlExist=$db->prepare($checkExistQuery);
$sqlExist->execute();
$rowExist=$sqlExist->fetch();
$exist = $rowExist['total'];
if($exist!=0)
{
$updateEmail = "UPDATE sp_subscription set status='1', verified='1', verify_date='$curDate' where email_id='$email'";
$sql=$db->prepare($updateEmail);
if($sql->execute())
{
$resultArrayData[]=array("status"=>1, "message"=>'Your email id is successfully verified');
}
}
else
{
$resultArrayData[]=array("status"=>0, "message"=>'something went wrong');
}
}
else
{
$resultArrayData[] = array("status"=>"error","message"=>"unauthorized access");
}
echo json_encode($resultArrayData);