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

Raphael Zwyer
Raphael Zwyer
924 Points

Task 2 of 2. I'm getting "Bummer! I am not seeing the word "Mike" in..." Using an editor it displays fine though.

I'm pretty sure this is correct. I tried to add head, meta, title... but I'm still getting the "Bummer! I am not seeing..." return. Using the same code in the workspace editor the name displays just fine. I'm not understanding what the error message tries to tell me. I also tried to strip the code to just pure <html> (no <body> tags), not working. If a positive return only comes with a very restricted code (no Doctype, no body or similar) this should be defined/emphasized.

index.php
<?php

$name = "Mike";

?>

<!DOCTYPE html>
<html>
  <body>
      <p><?php echo $name ?></p>
  </body>
</html>

2 Answers

Your code is entirely correct but it's actually more than what is being asked for. It just wants you to turn around and echo out the name inside of the same PHP block without any HTML.

Raphael Zwyer
Raphael Zwyer
924 Points

Thanks, Corey, I figured it must be something like that. They really should point that out!