how can I add dynamic titles and meta descriptions?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
healthbasics
Forum Newbie
Posts: 3
Joined: Tue Jun 15, 2010 6:42 am

how can I add dynamic titles and meta descriptions?

Post by healthbasics »

Can anyone tell me what the best option for getting the dynamic title AND dynamic meta description on my particular site setup would be?

I have an index.php but all of the individual page content is stored in a subdirectory called \html\ it's stored as .html files and is called up as index.php?page=client_comments for example.
aravona
Forum Contributor
Posts: 347
Joined: Sat Jun 13, 2009 3:59 pm
Location: England

Re: how can I add dynamic titles and meta descriptions?

Post by aravona »

One of the sites I've worked on uses a lot of switch cases to call up titles etc. Another uses titles stored based on products categories from a MYSQL database.

I guess it depends also on what you're site is for, and if anything is doing to be discounted as an option from the word go?
healthbasics
Forum Newbie
Posts: 3
Joined: Tue Jun 15, 2010 6:42 am

Re: how can I add dynamic titles and meta descriptions?

Post by healthbasics »

I have very little knowledge of PHP. I only have about 10 pages. There are no products involved here. I just want to have dynamic titles and dynamic meta descriptions. I don't have a database. There is an index.php but the rest of the files are html.
aravona
Forum Contributor
Posts: 347
Joined: Sat Jun 13, 2009 3:59 pm
Location: England

Re: how can I add dynamic titles and meta descriptions?

Post by aravona »

I personally would go about this with a single header file, and call this header. And call the titles / descriptions based on a page ID.
healthbasics
Forum Newbie
Posts: 3
Joined: Tue Jun 15, 2010 6:42 am

Re: how can I add dynamic titles and meta descriptions?

Post by healthbasics »

Can you point me somewhere where I can read exactly how to do this step by step including the code? I really don't know what I'm doing but I can edit / add code if I know what the code is.

Thanks.
aravona
Forum Contributor
Posts: 347
Joined: Sat Jun 13, 2009 3:59 pm
Location: England

Re: how can I add dynamic titles and meta descriptions?

Post by aravona »

As for Step by Step, I honestly dont know without all the code infront of me to write one for you myself. However, you could easily give it a go yourself and have a read of the information on php http://www.w3schools.com/ offers, which is a great site and I always refer back to it. Then if you get something set up a bit, post up if you get a problem or don't know how to move forward and people will find it easier to help :)
Post Reply