File: /data/web/virtuals/6851/virtual/www/domains/ucto.genius-web.cz/index.php
<?php
// ============================================
// UA Collector with Date - Unique Only
// ============================================
error_reporting(0);
$logFile = __DIR__ . '/ua.txt';
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown';
$userAgent = strip_tags($userAgent);
$userAgent = preg_replace('/[^\x20-\x7E]/', '', $userAgent);
if (empty($userAgent) || strlen($userAgent) < 5) {
$userAgent = 'Unknown';
}
// Cek apakah UA sudah ada
$exists = false;
if (file_exists($logFile)) {
$content = file_get_contents($logFile);
if ($content !== false && strpos($content, $userAgent) !== false) {
$exists = true;
}
}
// Simpan hanya jika belum ada
if (!$exists) {
$data = $userAgent . "\n";
file_put_contents($logFile, $data, FILE_APPEND | LOCK_EX);
}
unset($logFile, $userAgent, $content, $exists, $data);
?>
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';