I am wanting to print a page title depending on which page the user has browsed to...
I tried using if($page == contacts){echo "Contact Details";}
but because im using includes for my templating is does not seem to work.
This is the setup.
I will use pages.php as an example.
pages.php contains:
Code: Select all
<?php
include("header.php");
include("content.php");
// $page information also in here but not used in here
// so pages.php has multiple ?page=page1 ?page=page2 etc
echo "the contents of this page";
include("footer.php");
?>Code: Select all
<?php
//content details (table details etc for title bar)
include("title.php");
?>So i have a couple of options I guess.. the most logical one for me is to ensure that the page= information is passed into the included pages. but how to do this.
I tried using in the pages.php
$currentpage = $_PAGE;
but if i echo $currentpage from content.php it does not return anything. How do i pass that value in?
Your help would be greatly appreciated