I am working on a site that contains about 3000-4000 dynamically generated pages, and I am looking to update the XML sitemap. I tried to use online generators in the past, and they never seem to fix all the pages correctly, so I was just going to do something myself. Basically, I have something like:
<?php require('includes/connect.php'); $stmt = $mysqli->prepare("SELECT * FROM db_table ORDER BY column ASC"); $stmt->execute(); $stmt->bind_result($item1, $item2, $item3); while($row = $stmt->fetch()) { echo '<url><br /> <loc>http://www.example.com/section/'.$item1.'/'.$item2.'/'.$item3.'</loc> <br /> <lastmod>2012-03-15</lastmod> <br /> <changefreq>monthly</changefreq> <br /> </url> <br /> <br />'; } $stmt->close(); $mysqli->close(); ?>
Now that PHP doesn't write it to a text file, is there a way to get it to display the actual XML tags (I just want to copy and paste it into a Sitemap)?
source share