Jump to content

Recommended Posts

I try to make dinamic site map for my web page

 

this is the code:

 

<?php
        include_once("....som link");

$sql = "SELECT  * FROM rss_vesti";
$result = mysql_query($sql) or die(mysql_error());

echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
echo "<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\">";
while($row = mysql_fetch_assoc($result)) 
        { 
                 $id = $row['ID'];
                $datum = $row['DATUM'];
                ?>
                <url>
                        <loc><?php echo "http://sportskevesti.co/index.php?opcija=vest&vest_id=$id"; ?></loc>
                        <lastmod><?php echo $datum; ?></lastmod>
                        <priority>0.50</priority>
                        <changefreq>always</br></changefreq>
                </url>
                <?php 
        }
        ?>
                </urlset>

 

this is the resolt:

http://sportskevesti.co/sitemap.php

 

haiar i have comlete list of posible links, but google do not accespte this.

 

What is wrong, how to correct ?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/242580-dinamic-sitemap/
Share on other sites

Don't load that page. Will crash Chrome.

 

You are outputting WAY to much there.

 

yes, its lot of the record in database, around 10.000

 

bat Chrome work fine.

 

I agree that is to mach of output data, i will make last 100 record for example, but is not my problem now,

How to create XML map from this ? or i mast do somthing else ?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/242580-dinamic-sitemap/#findComment-1245912
Share on other sites

I haven't worked with Google sitemaps in a while. Try reducing the number to something really small like 20 and see what it says. What is Google saying when you try to submit it?

In this moment:

"Unsupported file format

Your Sitemap does not appear to be in a supported format. Please ensure it meets our Sitemap guidelines and resubmit."

 

FIle name: sitemap.php

 

how to make xml ?

is this good structure of sitemap ?

 

(fore one day i have over 100 inputs in data base, i cann not show litl number of record in finall resolt)

Link to comment
https://forums.phpfreaks.com/topic/242580-dinamic-sitemap/#findComment-1245928
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.