Posted inProgramming / Software / Technology / Tips and Tricks

Creating Dynamic XML Sitemaps Generator Using PHP MySQLi

Creating Dynamic XML Sitemaps Generator Using PHP MySQLi

Today, We want to share with you Creating Dynamic XML Sitemaps Generator Using PHP MySQLi.
In this post we will show you Building Dynamic Sitemap Using PHP, hear for Creating Dynamic XML Sitemaps using PHP we will give you demo and example for implement.
In this post, we will learn about SiteMap XML Dynamic SiteMap Generator Software with an example.

What is an XML Sitemap?

A Sitemap is one of Very Easy ways to Display Search or find your website online any Data or Content to the SEO – search engines like as Yahoo, Bing, Google etc.

Almost all More information or Defination of the Sitemap, We need to know about More Sitemaps is available at here www.sitemaps.org.

How To Create Dynamic XML Sitemaps Using PHP?

';
 
  $web_site = new smallblog();  // custom websites engine
  $res = $web_site->db_connect($blog_db_settings);
  if($res === false) {
    echo $sitemap_null;
    exit; // Live Database connection error...
  } else {
 
    // get all live_posts meta-data
    $live_posts = $web_site->getPosts(0, 0, '', '', '', now($site_timezone));
    if($live_posts === false) {
      echo $sitemap_null;
      exit; // Error retreiving live_posts...
    }
 
    $total_len = count($live_posts);
    for($pst = 0; $pst < $total_len; $pst++) {
      // entities encode URL according http://www.sitemaps.org/protocol.html#escaping
      $live_posts[$pst]['url'] = $set_url_pfx . htmlspecialchars($live_posts[$pst]['url']);
      // convert Your PHP dates to W3C Simple datetime format http://www.sitemaps.org/protocol.html#xmlTagDefinitions
      $live_posts[$pst]['date_updated'] = date_decode($live_posts[$pst]['date_updated'], $site_timezone, $datetime_w3c_format) . $offset_timezone;
    }
 
    // fetch max date
    $max_date = $live_posts[0]['date_updated'];
  }
 
  $results = '' . "\n";
  $results .= '' . "\n";
  echo $results;
?>

  http://www.pakainfo.com/web_site/
  
  daily


  http://www.pakainfo.com/web_site/archive/
  
  daily



  
  



How to submit Sitemap to search engines

1.First of all using the Any Most useful search engine’s Your URL submission interface user friendly (stands as Webmaster Tools)

1-Google Tools: Google Webmaster Tools
2-Bing Tools: Bing Webmaster Tools
3-Yandex Tools: Yandex Webmaster Tools
4-Baidu Tools: Baidu Webmaster Tools (Baidu is not English interface yet,so you will step by step convert hindi or english need Google translation on Google Translaters)

2.And then sending an HTTP request (see more)

3.and This sitemap used the location in your web site’s URL robots.txt Main file (Must submit means strongly recommended)

after that, Please main root path put your File and include a statement like:

Sitemap: http://www.yoursite.com/sitemap.xml
//Example
Sitemap: http://www.pakainfo.com/sitemap.xml

We hope you get an idea about Building Dynamic Sitemap Using PHP
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype