Link to home
Start Free TrialLog in
Avatar of Chris Labbate
Chris LabbateFlag for Canada

asked on

PHP Title Tag Inlcludes

I have a simple PHP website that I am currently doing SEO work on. I can see that the website was built with PHP and need some help on how to code the Meta Data. I can see that the site has Main Pages, Sub Pages and Includes which makes it hard for me to find where to put the data since they all mash together.

The Content.php page has the include to all other pages for the meta data which reads...

<?php 
	include ('includes/init.php'); 
	//if (count($pagesArray[$subIndex][2]) != null) //has subsections
	include ('includes/pages/'.$page.'.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Glos Associates Inc. | <?php echo $title; ?></title>
		<link rel="shortcut icon" href="favicon.ico" />
		<link href='http://fonts.googleapis.com/css?family=Lustria' rel='stylesheet' type='text/css'>
		<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
		<link href="jquery.minitwitter.css" media="all" rel="stylesheet" type="text/css"/> 
	</head>
	<body>

Open in new window


I am trying to individually Title each page and have separate descriptions for each. How do I do that with PHP using the <title>Glos Associates Inc. | <?php echo $title; ?></title>  include?

Should I delete all information in the content.php file and do each one separate or use some sort of include.

please see the website and the data that I have added. You can see that I am getting errors because they are 2 instances of Head tags, ect...

http://www.glosassociates.com
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Chris Labbate

ASKER

Thanks Ray for the tips:

Your Response:
The PHP script(s) will need to load the appropriate values into the $title variable before this line of code is executed.

My Question:
I am know HTML and advanced coding, just not 110% on my php. I understand the PHP Call to pull in the title, but what syntax do I use on the other pages to input the meta title?

Something like this?
$title = "Biographies of Company Executives : "
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
looking for the real answer, thanks. I know code, I will do it with the help of the right answer.