Dynamic Title Tag Question

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
ricardodacosta
Forum Newbie
Posts: 2
Joined: Mon Jun 15, 2009 8:10 pm

Dynamic Title Tag Question

Post by ricardodacosta »

Hello there, here Im looking for help

I have a php Question & Answer script that currently has an static title tag.

I would like to have the title of each question to be the title tag

On my database, I have a "question" table and there is a "title" field which is what I would like to somehow call on my title tag based on the "questionid" also.

Can someone tell me how to do this

Thanks!
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Dynamic Title Tag Question

Post by Christopher »

Fetch the row from the database that has the questionid you want and then display the title value (e.g. <?php echo $row['title']; ?> ) in both the heading and body of the page. There are many examples in the online PHP manual.
(#10850)
ricardodacosta
Forum Newbie
Posts: 2
Joined: Mon Jun 15, 2009 8:10 pm

Re: Dynamic Title Tag Question

Post by ricardodacosta »

Can someone post the necessary code for me? I am quite lost
Post Reply