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

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,868 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.