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

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,860 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,860 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) :)