/
home
/
u897542709
/
domains
/
zcardin.com
/
public_html
/
Upload File
HOME
<?php session_start(); require_once 'config.php'; require_once 'Mobile_Detect.php'; $detect = new Mobile_Detect; $user_id = $_SESSION['user_id'] ?? null; $public_id = $_GET['public_id'] ?? null; $device = $detect->getUserAgent(); $device_type = $detect->isiOS() ? 'iOS' : ($detect->isAndroidOS() ? 'Android' : 'Other'); $ip = $_SERVER['REMOTE_ADDR']; $timestamp = date("Y-m-d H:i:s"); // Get location info $location_data = json_decode(file_get_contents("http://ip-api.com/json/{$ip}")); $city = $location_data->city ?? ''; $country = $location_data->country ?? ''; // Save log $stmt = $pdo->prepare("INSERT INTO UserAccessLogs (public_id, user_id, ip_address, city, country, device_type, user_agent, accessed_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); $stmt->execute([$public_id, $user_id, $ip, $city, $country, $device_type, $device, $timestamp]); ?>