I want to use a variable in the <title></title> to display the name of the article being shown on the page.
Each page uses an included header and footer file, and output buffering is being used.
So each page starts like this..
...and header.php echos out the $page_title in the title tag.PHP Code:
$page_title = "Page Title";
However I want the $page_title varible to reflect the actual name of the article, which is set dynamically in the $article_title variable further down the page. Something like..
But of course due to the way I'm including the header this needs to be put before the variable is actually set causing the problem.PHP Code:
$page_title = $article_title;
$article_title = $result['title'];
I already use output buffering, is there a way i can use this to help? This has to be quite a common problem I think...
Thanks in advance! This has been a problem to me for a while and I can't figure out the best way around it!!