Change title depending on php include?

Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

watchintv

Thread Starter
Joined
May 27, 2005
Messages
136
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
 
Joined
Apr 30, 2005
Messages
3,012
in header.php have this in place of the title

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

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

MMJ

Guest
Joined
Oct 15, 2006
Messages
3,625
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)
 
Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top