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 trialEddie B
1,078 PointsI have no idea what I did wrong
working my way through php and failing. it should print "Mike" on screen.
<?php
$name = "Mike";
?>
<html>
<body>
<p><?php echo $name ?></p>
</body>
</html>
2 Answers
Chris Shaw
26,676 PointsHi Eddie,
This challenge doesn't ask for you to add any HTML around your echo
statement which is one reason why it's failing, the other reason is the echo
statement has to be on the line directly below your $name
variable which a requirement of the challenge.
<?php
$name = "Mike";
echo $name;
?>
You had the right mindset like other students, but the challenge wording seems to have thrown you off.
Happy coding!
Albert González
22,953 PointsYou forgot the semicolon ";" after variable $name:
<p><?php echo $name; ?></p>
Try it!
davor koteski
3,131 Pointsdavor koteski
3,131 Pointsyou forgot a semicolon after $name