| Server IP : 192.169.170.185 / Your IP : 216.73.216.97 Web Server : Apache System : Linux p3plmcpnl495852.prod.phx3.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64 User : akhilnew ( 1712764) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/akhilnew/public_html/psychiatrypaper/ |
Upload File : |
<?php
require_once('inc/config.php');
header("Content-Type: application/xml; charset=utf-8");
echo '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;
$today = date('Y-m-d');
$currentDir = basename(__DIR__);
$special = [$currentDir, 'archives'];
// Generate sitemap entries from the `pages` table
$stmt = $mysqli->prepare("SELECT name FROM pages WHERE name NOT IN ('search', 'login', 'signup', 'account', 'payment')");
$stmt->execute();
$stmt->bind_result($name);
while ($stmt->fetch()) {
// Determine URL
$loc = ($name === $currentDir) ? $baseurl : "{$baseurl}{$name}";
// Determine changefreq and priority
$isSpecial = in_array($name, $special, true);
$freq = $isSpecial ? 'daily' : 'monthly';
$priority = $isSpecial ? '1.0' : '0.8';
// Output sitemap URL block
echo "<url>\n";
echo " <loc>{$loc}</loc>\n";
echo " <lastmod>{$today}</lastmod>\n";
echo " <changefreq>{$freq}</changefreq>\n";
echo " <priority>{$priority}</priority>\n";
echo "</url>\n";
}
$stmt->close();
echo '</urlset>' . PHP_EOL;