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

Youssef Aziz
Youssef Aziz
1,403 Points

Code Challenge is not working

i used the below code to print Mike but the code challenge does not accept it

<?php $name = "Mike"; ?> <!DOCTYPE html> <html> <body> <h1><?php echo $name; ?></h1>

</body>

</html>

index.php
<?php $name = "Mike"; ?>
<!DOCTYPE html>
<html>
  <body>
    <h1><?php echo $name;?></h1>

  </body>  


</html>

1 Answer

William Li
PLUS
William Li
Courses Plus Student 26,867 Points

Hi, Youssef Aziz , I can see that you're getting the right solution here. Only problem here is that the Code Challenge is only asking for plain PHP code, putting all the extra HTML codes there might prevent the grader from getting a correct read of your solution.

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

This would be suffice. Hope it helps.