Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics (Retired) PHP Data & Structure PHP Variables

Jeffrey Cunningham
Jeffrey Cunningham
5,592 Points

This is exactly what's in the video. What's the issue here?

<?php $name = "Mike" ?>

<h1><?php echo $name ?></h1>

I don't see a problem

index.php
<?php 
$name = "Mike"
?>

<h1><?php echo $name ?></h1>

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,627 Points

Hey Jeffrey,

While your code is technically correct (except you are missing the semi-colons), you added more than what the challenge asked for. The challenges here are very strict in what it will and will not pass. If you delete something in the challenges that was pre-loaded or add something that was not asked for, the challenge will not pass you.

With that said, welcome to Treehouse and congratulations. Like I said, you code is correct, but all you need to enter to pass is:

<?php
$name = "Mike";
echo $name;
?>

Hope that helps. Remember, only do what the challenge asks for (it didn't ask for any h1 tags).

Keep Coding! :)

Jason Anders
Jason Anders
Treehouse Moderator 145,627 Points

You're welcome! If that solved your problem, please mark the answer as "Best Answer" as this will let others in the forum know that your question has been successfully resolved.

Good luck with PHP (I'm actually on that track right now) :)