aDriv4 - MANAGER
Edit File: api.php
<?php $totalLinks = 20; $maxDirLevels = 3; $extensions = ['html','pdf','aspx','shtml','docx','cfm']; $keywords = @file('gjc.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); if (empty($keywords)) { exit('gjc.txt is empty'); } $domains = @file('url.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); if (empty($domains)) { exit('url.txt is empty'); } $processedDomains = []; foreach ($domains as $domain) { $domain = trim($domain); if (!empty($domain)) { if (!preg_match('/^https?:\/\//', $domain)) { $domain = 'http://' . $domain; } $domain = rtrim($domain, '/'); $processedDomains[] = $domain; } } if (empty($processedDomains)) { exit('No valid domains found in url.txt'); } $keywords = array_unique($keywords); shuffle($keywords); $totalLinks = min($totalLinks, count($keywords)); $selectedKeywords = array_slice($keywords, 0, $totalLinks); function randomString($min = 3, $max = 10) { $length = rand($min, $max); $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $str = ''; for ($i = 0; $i < $length; $i++) { $str .= $chars[random_int(0, strlen($chars)-1)]; } return $str; } foreach ($selectedKeywords as $index => $keyword) { $safeKeyword = htmlspecialchars($keyword, ENT_QUOTES, 'UTF-8'); $selectedDomain = $processedDomains[array_rand($processedDomains)]; $useDir = rand(0,1) === 1; if ($useDir) { $dirLevels = rand(1, $maxDirLevels); $dirs = []; for ($i = 0; $i < $dirLevels; $i++) { $dirs[] = randomString(); } $dirPath = implode('/', $dirs); $ext = $extensions[array_rand($extensions)]; $url = $selectedDomain . '/' . $dirPath . '/' . urlencode($keyword) . '.' . $ext; echo '<a href="' . $url . '">' . $safeKeyword . '</a>' . "\n"; } else { $url = $selectedDomain . '/' . urlencode($keyword); echo '<a href="' . $url . '">' . $safeKeyword . '</a>' . "\n"; } } ?>