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

Lucille daCosta
Lucille daCosta
2,286 Points

Don't see what's wrong here.

I copied this from my Workspace where it worked fine. Any thoughts? Thanks!

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

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

4 Answers

Hi Lucille,

The challenge is just being picky. It will not accept two separate php code blocks. For this, we don't need any html either. Just echo the name variable beneath where it is assigned the value "Mike".

Cheers

Lucille daCosta
Lucille daCosta
2,286 Points

Yes--this was the problem after all. It worked perfectly. I thought I solved the problem before--but was mistaken.

Hey !

Add a semicolumn in your echo command !

Lucille daCosta
Lucille daCosta
2,286 Points

Thanks, but I just tried the same exact code and it worked now. No semi colon needed after the echo. BUT the semi colon after the word "Mike" is now in 'white' not greyed out like the example I sent above. I honestly think these tests don't always read right. Thank you!

Nick Gyeszat
Nick Gyeszat
1,459 Points

I was having the same problem. I had the code correct but it kept telling me it was wrong. I logged out and logged back in and it accepted the code.