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 trialAnnalyn Aguilar
Courses Plus Student 150 Points<?php echo $name ?> Will print the name right? why it says BUMMER when I check my work?
PHP Basic
<?php
$name = "Mike";
?>
<?php echo $name ?>
2 Answers
Ryan Field
Courses Plus Student 21,242 PointsHi, Annalyn. While what you have will work technically, the challenge wants you to put everything inside one php block. In addition, while you can omit semicolons for single-line blocks of PHP, it's always a good idea to include them so you don't run into errors if you decide to add on more code later.
Jonathan Grieve
Treehouse Moderator 91,253 PointsI can't think of a reason based on what I've learned today. Seems odd.
Is it looking for a different variable name of a different string? The code challenges look for something very specific. :-)
Annalyn Aguilar
Courses Plus Student 150 PointsNope, my code is right. I tried many times like
<?php
$name - "MIke"; echo $namel
?>
I still get a Bummer result.
I tried it again after posting and I know that I am correct. Browser problem I guess or a bug on Treehouse. Thank you for your reply.
Jeff Lemay
14,268 PointsThis code is not correct. You used a dash to define the name variable instead of an equal sign and the echo statement is for "namel" instead of "name".
What you posted originally was correct, the challenge just wants you to use a single php block like Ryan suggested in the other answer.
Annalyn Aguilar
Courses Plus Student 150 PointsLol yeah, the second one is really wrong. That is not a copy and paste, I was typing so fast :)
Jeff Lemay
14,268 PointsJeff Lemay
14,268 PointsThis challenge seems to come up every other day where people run into the same issue. Is it possible for Treehouse to add to the BUMMER saying "Make sure your code is in a single php block"?
Annalyn Aguilar
Courses Plus Student 150 PointsAnnalyn Aguilar
Courses Plus Student 150 PointsI tried that one too. I tried all the things that I know. I'm sure it's a technical reason.
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsMaybe someone can ask this in treehouse support. So we can get such a message on there. :-)
Ryan Field
Courses Plus Student 21,242 PointsRyan Field
Courses Plus Student 21,242 PointsJeff Lemay : I'm sure it would be possible from a technical perspective, but I don't work for Treehouse, so you'd have to contact support.
Annalyn Aguilar : I just tried the challenge, and it passes. You need to do something like this:
Annalyn Aguilar
Courses Plus Student 150 PointsAnnalyn Aguilar
Courses Plus Student 150 PointsYup. I also did that and it passed. That was right after I posted this q.