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 trial
geoffrey
28,736 PointsWrong title displayed for index.php
Hello everyone, I've lately subscribed here to learn PHP, I hope to learn a lot from this website which seems great !
However, I'm having some troubles solving a little issue with the dynamic title of the page in the php track.
All the pages display well the name of the page thanks my variable $pageTitle, except the index.php...
Instead displaying what I put in the variable which is "Welcome here", It displays some html/css tags. I don't understand the reason of this...
Things such as "<br/> <font size="2" table class="xdebug ..."
All is looking good to me. Does anonyne have already experienced such issue ? I'm sure that's something stupid...
3 Answers
geoffrey
28,736 PointsWell, that was indeed stupid, I had forgotten to define the variables at the top of the index.php file. That's why, sorry for that stupid question.
Lee Burchfield
10,475 PointsSounds like you might be missing an opening or closing bracket somewhere in the code on that page. Maybe you could post the code for index.php?
geoffrey
28,736 PointsFor sure, here is the code.
<?php
$pageTitle="welcome here";
include('inc/header.php');
?>
<div id="content">
<div class="section banner">
<div class="wrapper">
<img class="hero" src="img/mike-the-frog.png" alt="Mike the Frog says:">
<div class="button">
<a href="#">
<h2>Hey, I’m Mike!</h2>
<p>Check Out My Shirts</p>
</a>
</div>
</div>
</div> <!-- #section banner"-->
<div class="section shirts latest">
<div class="wrapper">
<h2>Mike’s Latest Shirts</h2>
<ul class="products">
<li><a href="#">
<img src="img/shirts/shirt-108.jpg">
<p>View Details</p>
</a>
</li><li>
<a href="#">
<img src="img/shirts/shirt-107.jpg">
<p>View Details</p>
</a>
</li><li>
<a href="#">
<img src="img/shirts/shirt-106.jpg">
<p>View Details</p>
</a>
</li><li>
<a href="#">
<img src="img/shirts/shirt-105.jpg">
<p>View Details</p>
</a>
</li>
</ul>
</div><!-- #wrapper-->
</div><!-- #section shirts latest-->
</div>
<?php include('inc/footer.php') ;?>