<?php
    include('../SecurityChecked/StringAuthenticationStrict.php');
    StrictSecurityChecked();
	include('../config.php');      
     
    $stmt=$conn->prepare("select * from additional_email where valid_id=:valid_id");		
	$stmt->execute(array(':valid_id'=>$_REQUEST['valid_id']));
	$rows=$stmt->fetch();	
    $affected_rows  = $stmt->rowCount();
	if($affected_rows > 0)
	{ 
        if($rows['verified'] > 0)
	    {
			$msg="<span style='color:green;'>Email Already Verified !!!</span>";
        }			
		else 
		{ 
			$stmt=$conn->prepare("update additional_email set verified=1,valid_id='' where id=:id");   
			$stmt->execute(array(':id'=>$rows['id']));
			$msg1="<span style='color:green;'>Email Verified Successfully!!!</span>";	
		}
	}  
	else
		$msg2="<span style='color:red;'>Link Expired!!!</span>";//'<script>alert("Email Validation Not Done!!!")</script>'; 
	
	
	$filename = basename(__FILE__); 
	include_once("../view/login/".$filename); 
?>