-
Notifications
You must be signed in to change notification settings - Fork 0
/
sitemap.php
46 lines (31 loc) · 1010 Bytes
/
sitemap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
header("Content-Type: application/xml; charset=utf-8");
$domain = "skiyen.rf.gd/";
$ssl = "http://";
$base_url = $ssl.$domain;
?>
<?php
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("gen_conn.php");
$query = "SELECT page_url FROM sitemap ORDER BY page_id DESC";
$data = mysqli_query($conn,$query);
if($data){
while($row = mysqli_fetch_assoc($data)){
echo '<url>' . PHP_EOL;
echo '<loc>'.$base_url.$row['page_url'].'</loc>' . PHP_EOL;
echo '<changefreq>daily</changefreq>' . PHP_EOL;
echo '</url>' . PHP_EOL;
}
}else{
echo '<url>' . PHP_EOL;
echo '<loc>http://skiyen.rf.gd</loc>' . PHP_EOL;
echo '<changefreq>daily</changefreq>' . PHP_EOL;
echo '</url>' . PHP_EOL;
}
echo '</urlset>';
?>