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 trialDavid Dassau
8,628 PointsName not showing up in the footer
I followed the video verbatim, and my name is showing up in the Title and Sidebar, but not in the footer for some reason. Here's my source code:
<?php
$display_name = 'David Dassau';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>PHP Basics by <?php echo $display_name; ?></title>
<link href="css/style.css" rel="stylesheet" />
</head>
<body>
<div id="wrap">
<section class="sidebar text-center">
<div class="avatar">
<img src="img/logo.png" alt="Alt For Image">
</div>
<h1><?php echo $display_name; ?></h1>
<p>Contact:<br />
<a href="mailto:">EMAIL</a></p>
<hr />
<ul class="social">
<li><a href=""><span class="icon twitter"></span></a></li>
</ul>
<hr />
<p>Today: D, d M Y</p>
</section>
<section class="main">
<h1>My First PHP Page</h1>
<h2>Unit Conversion</h2>
<hr />
<h2>Daily Exercise</h2>
</section>
</div>
<section class="footer text-center">
© 2016 <?php echo $display_name; ?>
</section>
</body>
</html>
2 Answers
Paul Engering
11,689 PointsJust adding an empty space after ... ?> in the footer did the trick for me.
Nick Fite
11,168 PointsHow did you get it it work? I had the same issue.
Lucas Dominguez
2,460 PointsSame issue here, anyone?
Lucas Dominguez
2,460 PointsI just figured out, it's working when you add a p tag.
<p> © 2016 <?php echo $display_name; ?></p>
displays properly my name in the footer section.
David Dassau
8,628 PointsDavid Dassau
8,628 PointsNevermind, I got it to work!