<?php 
    require_once 'conn.php';
    if(isset($_GET['v'])){
        $v = trim($_GET['v']);
        $t = (isset($_GET['t'])) ? ($_GET['t'])  : time() ;
        if(!empty($v)){
            // echo $v;
    
    $q="select * from info where 1";
    $r = mysqli_query($conn,$q);
    // echo 'jjjj----'.$v;
    while($qr= mysqli_fetch_assoc($r)){
        $db_email = $qr['email'];
        echo md5($db_email)." - $v <br>";
        if(md5($db_email) == $v ){
            $q="update info set email_verified ='1' where email = '$db_email'";
                mysqli_query($conn,$q);
              ($_SESSION['user_verified']=true);
            	header('location:../login.php'); 
            if($t> time()){
                $q="update info set email_verified ='1' where email = '$db_email'";
                  mysqli_query($conn,$q); 
                  $_SESSION['user_id'] = md5(strtolower($db_email));
                   header('location:/user');
            }
        }else{ echo 'none<br>'; }  
    }
        echo '<br> <br> done <br> <br>' ;        
        }else{
             header('location:/');
       
        }
        
    }else{
        header('location:/');
    }

?>