<?php
ob_start();
require_once("../includes/classe.cs.php");
$cs = new cs;
session_write_close();
ob_end_clean();

if(isset($_GET['u']) && isset($_GET['p'])){
  $u = $cs->filterKey($_GET['u']);
  $p = $cs->filterKey($_GET['p']);
  list($sql) = $cs->fetchQuery($cs->executeQuery("SELECT * from usuarios WHERE `id` = '{$u}' AND `senha` = '{$p}'"));
  if(empty($sql)){
    die(".");
  }else{
    $t = 'http://192.99.174.68:25461/get.php?username='.urlencode($sql['iptv_id_login']).'&password='.urlencode($sql['senha']).'&type=m3u_plus&output=ts';
    die(header("Location: $t"));
  }
}else{
  die(header("Location: ../"));
}
?>
