Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 12th, 2003, 11:39 AM
Authorized User
 
Join Date: Jun 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Dan Jallits Send a message via MSN to Dan Jallits Send a message via Yahoo to Dan Jallits
Default Database Driven Website w/ META tags

I am in the process of completing a web site for a friend that took it up as a project. The inital site was never completed because the original designer/developer didn't know boo about anything.

So now I am looking for a resource that explains how to add dynamic META tags to a Database Driven Website. The tags, stored in the database along with the content, need to be relevant to the page that is currently being viewed, not randomly generated.

This in theory will generate better Search results from Google, Yahoo, etc. The Keyword field will also be utilized to search the site, generating a results page that includes a linked page tile, its relevance, and the page description. Possibly even the creation/modify date and author.

I should also mention that I am using what I like to call "the three-file simple template method". That is a header file that contains the head section and the begining of the body section. A main file that contains the main content of the site. Last a footer file that contains the copyright information, and closes the body and html tags.

Any help would be greatly appreciated.

Best Regards,
Dan Jallits
__________________
Best Regards,
Dan Jallits
 
Old June 13th, 2003, 12:39 AM
Authorized User
 
Join Date: Jun 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

While I do not have a specific resource that explains this, I have done similar things millions of times.

My thoughts are this: For database structure, there are 3 core tables, one containing the body code forthe document, the next containing all of the unique keywords that you may use on your site (emphasis on unique, no need for dupes), and the last table for linking it all together. The body table will contain cells for the last updated date and time, as well as the author and any other relevant information you need.

Now how this all comes together is this. You make some sort of admin section that allows you to "assign" keywords to specific pages. When you assign a keyword to a page, a resord will be added to the 3rd table. That table would essentially only contain 3 columns. The first being a unique id number for that record, the second holding the id number of the body document, and the last containing the id of the keyword. Multiple records can be added for each body document with different keywords assigned to each.

Now of course comes the question of what the heck to do with all of it once it's gotten this far. Well, when you tell the page to pull the specific body document from the database, you tell it to select all of the instances of that body showing up in the linking table. This in turn will give you all of the unique id's of keywords associated with that document. Now with a while look, you have the database pull the record for each keyword based on the id number and build the meta keyword string as it goes.

As for showing the date modified and author info in the meta tags as well, just select those cells from the body document table when you select the body content. Should be pretty straight forward.

If you'r still lost, respond to this and I will try to explain it more.

----------
~cmiller
 
Old June 16th, 2003, 11:42 AM
Authorized User
 
Join Date: Jun 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Dan Jallits Send a message via MSN to Dan Jallits Send a message via Yahoo to Dan Jallits
Default

Thanks for quick synopsis. I am now in the process of taking your approach. If I run into a problem I will email. Thanks again.

Best Regards,
Dan Jallits





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using meta tags amatytfc ASP.NET 2.0 Basics 1 August 6th, 2007 05:47 PM
meta tags ferlach HTML Code Clinic 5 June 5th, 2007 04:17 PM
META tags and master pages thenoseknows ASP.NET 2.0 Professional 1 October 9th, 2006 01:02 PM
MasterPages ContentPages and Meta tags michaelcode ASP.NET 2.0 Basics 5 June 1st, 2006 04:13 PM
Meta tags Adam H-W HTML Code Clinic 2 November 19th, 2003 11:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.