sitemap for php website

Solutions on MaxInterview for sitemap for php website by the best coders in the world

showing results for - "sitemap for php website"
Amelia
13 Aug 2017
1<?php 
2header("Content-type: text/xml");
3echo '<?xml version="1.0" encoding="UTF-8" ?>';
4include 'includes/connectdb.php';
5?>
6
7<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
8
9    <url>
10        <loc>http://www.DOMAIN.co.uk/</loc>
11        <priority>1.00</priority>
12    </url>
13
14    <?php
15
16    $sql = "SELECT * FROM pages WHERE onshow = 1 ORDER BY id ASC";
17    $result = mysql_query($sql,$conn);      
18    while($row = mysql_fetch_array($result))
19    { 
20    $filename = stripslashes($row['filename']);
21    ?>
22    <url>
23        <loc>http://www.<?php echo "$domain"; ?>/<?php echo "$filename" ?></loc>
24        <changefreq>monthly</changefreq>
25        <priority>0.5</priority>
26    </url>
27
28 <?php } ?>
29
30</urlset>
31