Sep 25, 2008

Dynamic Google Sitemap Easy to Create

Now some theory

First - we need a site which we want to be "mapped". I'll show a basic one:

  • index.php - main page which is showing news.
  • tutorials.php - this page is showing a list of tutorials.
  • vievtutorial.php - and this one is showing selected tutorial.
  • contact.php - just a static page.

Schema:

image 1

vievtutorial.php file shows tutorial which ID is typed in ?id=NUMBER.

All news and tutorials are stored in MySQL database. Here are sample tables:

Tutorials:

tutorials_id tutorials_name tutorials_text tutorials_date
1 tutorial 1 some txt 2007-09-03 08:36:27
2 tutorial 2 and more... 2007-09-15 17:06:16

News:

news_id news_title news_text news_date
1 news1 some text 2007-09-03 08:36:27
2 news2 and more... 2007-09-15 17:06:16

Database details:

Username: username
Password: password
Database: database

Time to write some code.

First we have to make our map skeleton with some needed stuff (for example database connection)

For More Details : http://www.webdesign.org/web/web-programming/php/dynamic-php-google-sitemap.13540.html

No comments: