<?php 
   /* include '../html/htmlini.php';
    include '../html/linkprincipal.php';
    include '../html/htmlfin.php';*/

    if(isset($_POST['loja'])) {
      setcookie("codloja", $_POST['loja'], 0,'/');

      include_once '../bd/bd_loja.php';
      include_once '../bd/funcoes.inc';
      $loja = getStore($_POST['loja']);
      setcookie("tokenAutorizacao", $loja['token_autenticacao_api_nfe'], 0,'/');
    }

  
    echo " <SCRIPT>
            self.location.href='../html/cadastro.php';
          </SCRIPT>";
 ?>
