# Change title depending on php include?



## watchintv (May 27, 2005)

My site is setup so the content pages call the header.php and the footer.php files. This means that the title in the header.php is the title used for all of the pages. Is there a way my site can change the title of the page depending on what content page is being displayed? If you dont understand what I mean, let me know.

Thanks


----------



## namenotfound (Apr 30, 2005)

in header.php have this in place of the title


```
<?php echo $title; ?>
```
then in the content pages have this (make sure you put $title before the include)


```
<?php
$title = "The title of this page";
include("header.php");
?>
```


----------



## watchintv (May 27, 2005)

It worked, thanks for your quick reply!


----------



## namenotfound (Apr 30, 2005)

glad I could help


----------



## MMJ (Oct 15, 2006)

watchintv said:


> My site is setup so the content pages call the header.php and the footer.php files. This means that the title in the header.php is the title used for all of the pages. Is there a way my site can change the title of the page depending on what content page is being displayed? If you dont understand what I mean, let me know.
> 
> Thanks


Hmm... Did you see this from Xenweb? If you did then glad I could help. 

(weird)


----------



## namenotfound (Apr 30, 2005)

MMJ said:


> Hmm... Did you see this from Xenweb? If you did then glad I could help.
> 
> (weird)


 

http://xenweb.net/forums/showpost.php?p=17421&postcount=8

I gave you the solution on Xenweb too


----------

