<?php
include_once('../inc/helper.php');
session_start();
ob_start();
$userIP = getUserIP();

if (isset($_POST['check']) && isset($_POST['t']))
{
    $sql = "SELECT * FROM logs WHERE id = :id AND ipaddr = :ipaddr";
    $stmt = $db->prepare($sql);
    $stmt->execute(['id' => $_POST['t'], 'ipaddr' => $userIP]);
    $checkLog = $stmt->fetch(PDO::FETCH_OBJ);
    if ($checkLog->status != 0) {
        die($checkLog->status);
    }
}