<?php
/**
 * DYNAMIC SITEMAP GENERATOR
 * This creates a sitemap that Google can read
 */

header('Content-Type: application/xml; charset=utf-8');

// Base URL
$baseUrl = 'https://optimuspowerlifting.com';

// List all your pages
$pages = [
    '',
    'classes.php',
    'prices.php',
    'gallery.php',
    'about.php',
    'faq.php',
    'contact.php'
];

// Generate XML
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";

foreach ($pages as $page) {
    $url = $baseUrl . '/' . $page;
    $priority = ($page === '') ? '1.0' : '0.8';
    echo "\t<url>\n";
    echo "\t\t<loc>" . htmlspecialchars($url, ENT_XML1, 'UTF-8') . "</loc>\n";
    echo "\t\t<priority>" . $priority . "</priority>\n";
    echo "\t</url>\n";
}

echo '</urlset>';
?>