Veritabanından Sitemap Çekmek
Öncelikle bu kodu bir yeni metin belgesine atıyoruz ;
Şimdi htttp://www.siteadi.com/yazi.php?yazi_id=$haber_id kısmını düzenliyelim.$haber_id = $veri["id"]; Kısmındanda yarattığınız "kullandığınız" scripte göre linklerin sonuna gelen id'leri tanımlıyoruzKod:<? include "config.php"; ?> <?php $xml_ciktisi="<?xml version=\"1.0\" encoding=\"windows-1254\"?><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\">\n"; $isimx=mysql_query("SELECT * FROM veritabanı_adı WHERE onay='e' ORDER BY id DESC");; while($link = mysql_fetch_array($isimx)) { $haber_id = $veri["id"]; $date = date("F d, 20y"); $xml_ciktisi .= "<url> <loc>http://www.siteadi.com/yazi.php?yazi_id=$haber_id</loc> <lastmod>$date</lastmod> <changefreq>daily</changefreq> <priority>0.5</priority> </url>\n"; }; $xml_ciktisi .= "</urlset>\n"; echo $xml_ciktisi; ?>


LinkBack URL
About LinkBacks






Alıntı
