<?php
header('Content-Type: application/xml; charset=utf-8');
$baseUrl = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https' : 'http') . '://' . ($_SERVER['HTTP_HOST'] ?? 'localhost');
// For Hostinger, it's usually / or your folder. Update $baseUrl paths if needed.
  $paths = [
  '/index.php',
  '/about.php',
  '/services.php',
  '/projects.php',
  '/contact.php'
];
$now = date('c');
?>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <?php foreach ($paths as $p): ?>
    <url>
      <loc><?php echo htmlspecialchars($baseUrl . $p); ?></loc>
      <lastmod><?php echo $now; ?></lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.8</priority>
    </url>
  <?php endforeach; ?>
</urlset>

