How to add title to a post in php?

Hello, I have I problem with a news script that I have. I can easily post things, but when someone visit one of my “news”, the title of the page is always the same. I would like to change the code to make the title reproduce the name of the website and the news title.

This is a example, where you can understand better: http://demo15.web47.net/index.php

You can visit any news, but the title in your browser will never change.

So, trying to correct it, I found more information about what I want. As you know, the website have the same title in any page, and I want it to show the title of the specified page. Sooo…

The title that I need to be showed is in a mysql table called noticias_dados, in the column called “titulo”. So I need to find a way to get the information of this place to be showed in the user browser, remembering that is changes post to post.

Someone have any idea about how could I do it?

We’re getting there. The next thing you need to find is the code to render the item - once you have that, someone will patch it up.

I don’t know exactly how, but the comments section use this code:

<tr> <td align="center"> <? if($_GET[pg] != "noticia"){ $sql2 = mysql_query("SELECT * FROM noticias_dados WHERE id='$id'"); $dados2 = mysql_fetch_array($sql2); echo "from the news<br><em>$dados2[titulo]</in the day>";}?></td> </tr>

I believe it would be something related to that, right?

Trying to see if this code can be adapted to what I want…

Sponsor our Newsletter | Privacy Policy | Terms of Service