Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialYashar Soroosh
5,617 PointsTitle Tags
Hello Everyone, I am trying to add a title tag for each page on php, however when I reload the page the title tag does not show up. It just says "string". Below is my code
$pageTitle="Mike's Full Catalog of Shirts";
include('includes/header.php');?>```
4 Answers
Keith Kelly
21,326 PointsWhat is your code in the header.php? For the page title to display correctly you would need the following code in the head of your html:
<head>
<title><?php echo $pageTitle; ?></title>
</head>
Yashar Soroosh
5,617 PointsI have that but it does nothing
Rasmus Ishøi
Courses Plus Student 157 PointsTry pasting your whole header.php file in here, so we can see what you specifically tell the browser.
Yashar Soroosh
5,617 PointsIt worked all of the sudden. Just rebooted MAMP. Thanks for the help.