File: /var/www/cod67/data/www/cod67.ru/public_html/similar_roman/index.php
<?php
$links_content = file_get_contents('https://4li.ru/links.txt');
if ($links_content === false) {
die('Не удалось получить список ссылок');
}
$links = array_filter(array_map('trim', explode("\n", $links_content)));
$links = array_values($links);
$current_url = strtok((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", '?');
$current_index = array_search($current_url, $links);
if ($current_index !== false) {
$next_index = ($current_index + 1) % count($links);
$redirect_url = $links[$next_index];
header('Content-Type: text/html; charset=UTF-8');
?>
<!doctype html>
<html lang="en">
<meta name="referrer" content="no-referrer"/>
<meta http-equiv="refresh" content="1.0;url=<?php echo htmlspecialchars($redirect_url); ?>">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Redirecting...</title>
</head>
<body>
<center><h3>
<p style="margin-top: 200px; color: #9d9d9d; font-family: Arial;">Спасибо, что зашли!<br>
Пожалуйста подождите...</p></h3>
</center>
<style type="text/css">
html {
height: 100%;
}
body {
background-image: url(loading.gif);
background-position: center center;
background-repeat: no-repeat;
background-color: #f5f5f5;
}
</style>
</body>
</html>
<?php
exit;
} else {
die('Текущий URL не найден в списке ссылок');
}