php konusunda çok fazla bir bilgim yok hatta hiç yok diyebiliriz.
yeni açtığım sitem için site haritası oluşturmak istiyorum.
sitem:
http://www.kapakresimlerim.com/
bu konuda nasıl bir yol izlemeliyim önerilerinizi ve yardımlarınızı bekliyorum.
<?php
header("Content-Type: text/xml; charset=utf-8");
require("inc/inc_config.php");
$xml ='<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>'.$root.'</loc>
<lastmod>2012-10-25</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>';
$veri = mysql_query("SELECT * FROM posts ORDER BY date DESC");
while($yaz = mysql_fetch_array($veri)){
$link = $root."urunler/".$yaz["id"]."-".$yaz["sef"]."/";
$baslik = $yaz["post_baslik"];
$tarih = $yaz["tarih"];
$xml.= '<url>
<loc>'.$link.'</loc>
<lastmod>'.$tarih.'</lastmod>
<changefreq>always</changefreq>
<priority>0.5</priority>
</url>
';
}
$xml .= '</urlset>';
echo $xml;
?>