I did read this thread: http://phpbuilder.com/board/showthread.php?threadid=10206640&highlight=dynamic+title but what i need is a little different...
These are the things i have on my page(index.php) in order:
require ('header.php');
some tables and navigation
switch ($id) (to switch between different selected pages)
require ('footer.php');
My problem: I want the title to reflect the page chosen from navigation, so each page has a different title. If i use cases on the index page, its going to get big, since i have a lot of pages.
In your opinion, how can i keep the $title value in the content page(s) and then display it in the main page? I tried putting something like that in the pages:
<?
$title = "The title of the page";
?>
And this in the header.php <? echo $title; ?>
Offcourse it didnt work 😃
I have one problem yet.. (or i think it might be) The html, head, title and body tags are in the header(which is included from the main page), and the content page(s) load in the main page as well. Wouldn't that affect where i have to place the $title variable, so $title actually equals to something before the page itself loads? What i mean is, would the $title = "The title of the page"; have to load before <? echo $title; ?> ? Sorry, too confusing. I could eliminate the header if needed. Sorry to put so much strain on, at once. Any help would be highly appreciated! 🙂