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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![shane smales](https://uploads.teamtreehouse.com/production/profile-photos/1804092/micro_download.jpg)
shane smales
1,933 Pointswhy wont it accept my if statements
as soon as i input if statments it wont display the preview page in workspace on port 80
here is my code:
<?php
define("USE_FULL_NAME", FALSE); define("MAX_BADGES", 150000);
$first_name = "Hampton"; $last_name = "Paulk"; $location = "Orlando, FL"; $role = "Teacher";
if( USE_FULL_NAME == TRUE){ £name = $first_name.' '.$last_name; }else{ $name = $first_name; }
if( $role == 'Teacher' ){ $info = "I am a Teacher at Treehouse."; }
?>
6 Answers
![Jeff Busch](https://uploads.teamtreehouse.com/production/profile-photos/306482/micro_Ben_Franklin_510_copy_02.jpg)
Jeff Busch
19,287 PointsHi shane,
This is funny, to me anyhow. In the States we don't have a key for the British Pound, we only have the dollar sign ($). Look in the first if statement.
Jeff
![Bill Hinostroza](https://secure.gravatar.com/avatar/3496131ce8e028b1e013bd91cdd0d1d1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Bill Hinostroza
19,273 PointsThe reason your code is failing is because your constant "USE_FULL_NAME" is false. Your first if statement is checking if that constant is equal to true but it isn't. That's why your code isn't passing.
if( USE_FULL_NAME == TRUE)
![shane smales](https://uploads.teamtreehouse.com/production/profile-photos/1804092/micro_download.jpg)
shane smales
1,933 Pointshaha its right next to the dollar sign on my mac, my mistake all though it still wont run. for some reason it wont run any loops or if statements.
![Jeff Busch](https://uploads.teamtreehouse.com/production/profile-photos/306482/micro_Ben_Franklin_510_copy_02.jpg)
Jeff Busch
19,287 PointsWhat is it supposed to do? There is no code to output anything. Before I fixed the variable the page wouldn't load, after the page loads but of course there is no output.
![shane smales](https://uploads.teamtreehouse.com/production/profile-photos/1804092/micro_download.jpg)
shane smales
1,933 PointsIts suppose to alter the side bar in the PHP basics tutorial.
I managed to complete the tutorial without getting the code to work
thanks for all your help though especially with the $ sign haha
![David Bilson](https://secure.gravatar.com/avatar/851f638deb14e797bbb3b60bdef062f5?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
David Bilson
13,819 Points<?php
define("USE_FULL_NAME", FALSE); define("MAX_BADGES", 150000);
$first_name = "Hampton";
$last_name = "Paulk";
$location = "Orlando, FL";
$role = "Teacher";
if( USE_FULL_NAME == TRUE) {
$name = $first_name. ' ' .$last_name;
}else {
$name = $first_name;
}
if ( $role == 'Teacher' ) {
$info = "I am a Teacher at Treehouse.";
} else {
$info = "I am not a Teacher at Treehouse";
}
?>
Shane, what you are missing is the statement to echo the $info variable in the sidebar.
<section class="sidebar text-center">
<div class="avatar">
<img src="img/avatar.png" alt="Mike The Frog">
</div>
<h1><?php echo $name; ?></h1>
<p><?php echo $location; ?></p>
<hr />
<p><?php echo $info; ?></p>
<hr />
<ul class="social">
<li><a href=""><span class="icon twitter"></span></a></li>
</ul>
</section>
For the page to display USE_FULL_NAME to be set to TRUE.
define("USE_FULL_NAME", TRUE);
Likewise if your variable $role is not equal to "Teacher" it will display "I am not a Teacher at Treehouse."