Hi,
I have a script below which has been working fine however i have just moved server and rather than showing the page, it now just downloads it. Any ideas? The page is called sitempa.xml and the script is below. My thoughts is that the new server does not support something but not sure what to ask them to activate.
I have a script below which has been working fine however i have just moved server and rather than showing the page, it now just downloads it. Any ideas? The page is called sitempa.xml and the script is below. My thoughts is that the new server does not support something but not sure what to ask them to activate.
Code:
<?php
// include init which contains all the includes.
include('init.php');
function stripres($value){
$value = strtr($value, "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ. ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz--");
$value = ereg_replace('[^a-zA-Z0-9_-]', '', $value);
return $value;
}
header('Content-Type: application/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<?php
$result = mysql_query("SELECT * FROM `pages` WHERE memberid = '$resv[id]' AND page_link = ''");
while ($row = mysql_fetch_assoc($result)) {
?>
<url>
<?php
if ($row['page_name'] == 'Home Page'){
?>
<loc>http://<?php print $_SERVER['HTTP_HOST']; ?></loc>
<?php }else{ ?>
<loc>http://<?php print $_SERVER['HTTP_HOST']."/".$row['page_url'].".html"; ?></loc>
<?php } ?>
<lastmod><?php print $row['sdate']; ?></lastmod>
<changefreq>daily</changefreq>
<priority>0.5</priority>
</url>
<?php } ?>
</urlset>
Comment