<?php
session_start();
//header("Content-Type: text/html; charset=UTF-8",true);
include "../classes/db.class.php";
include "../classes/fc.class.php";

   if(isset($_POST['opt']) && isset($_SESSION['vnm'] ) && isset($_SESSION['vem'])){
        $opt= $_POST['opt'];
        $email= $_SESSION['vem'];
        $nome= $_SESSION['vnm'];
        $nome= strtoupper($nome);
        
       
    }else{
        echo "erro";
        exit;
    }
    
    $valida=FC::validaopt($nome,$email,$opt);
    if($valida==false){
        echo "erro";
        exit;
    }
   

    unset($_SESSION['vem']);
    unset($_SESSION['vnm']);

    echo "ok";
    exit;
  
