You might notice that on most professional sites, the title looks something like:
QUOTE
SiteName :: Page Title


This is conviently done, and it can be change with one file for the whole site, if you set it up right. Here's how.

Create a page in the root folder of your site with PHP installed. Name the page GlobalTitle.php.

(You can also include this in another file if you rather, like say settings.php, config.php, or functions.php. Do this if you plan on including other things in the file.)

In the file, paste this code:
CODE




<?php

function PageTitle() {

global  $PageTitle; //on each page, we'll set this variable to be the second part of the Title



$SiteName = "YourSiteNameHere";



//SiteName for title.  

echo "<title>" . "$SiteName" . "&nbsp;::&nbsp;" . "$PageTitle" . "</title>";



}

?>





Now inside the header of each page, do this:

CODE


<?

$PageTitle = "Whatever title this might be";

include($_SERVER['DOCUMENT_ROOT'].'/GlobalTitle.php');

 PageTitle();

?>

 

 

 


Reply