<?php
ob_start();
require_once(dirname(__FILE__) . '/../beta/vendor/classe.cs.php');
//require_once(dirname(__FILE__) . '/../includes/classe.cs.php');
$cs = new cs;
session_write_close();
ob_end_clean();

if(isset($_GET['key'])){
  $u = $cs->filterKey($_GET['key']);
  list($sql) = $cs->fetchQuery($cs->executeQuery("SELECT * from redirecionamento WHERE `id_key` = '{$u}'"));
  if(empty($sql)){
    die(header("Location: ../"));
  }else{
    $t = $sql['url_redirecionar'];
    die(header("Location: $t"));
  }
}else{
  die(header("Location: ../"));
}
?>
