Server : LiteSpeed System : Linux in-mum-web983.main-hosting.eu 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : u520472703 ( 520472703) PHP Version : 8.2.29 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail Directory : /home/u520472703/domains/gadhiaassociate.com/public_html/ |
<?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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">' . PHP_EOL;
include("admin/includes/config.db.php");
include("admin/includes/helper.php");
$base_url = 'https://' . $_SERVER['HTTP_HOST'];
?>
<url>
<loc><?= "$base_url/" ?></loc>
<lastmod>2023-09-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc><?= "$base_url/blog.php" ?></loc>
<lastmod>2023-09-01</lastmod>
<changefreq>daily</changefreq>
</url>
<?php
//sitemap.php
$query = "select * from gallery WHERE c_id IS NOT NULL";
$result = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($result)) {
$title = preg_replace('/[^a-zA-Z0-9]+/', '-', strtolower($row["title"]));
echo '<url>' . PHP_EOL;
echo '<loc>' . $base_url . "/article/" . $title . "?id=" . $row["id"] . '</loc>' . PHP_EOL;
echo '<lastmod>' . substr($row["created_at"], 0, 10) . '</lastmod>' . PHP_EOL;
echo '<changefreq>daily</changefreq>' . PHP_EOL;
echo '</url>' . PHP_EOL;
}
echo '</urlset>' . PHP_EOL;
?>