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

Code Challenge problem

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

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

When I try to execute the following script on question:

Challenge Task 2 of 2

Now echo Mike's Name To The Screen.

I am continuously getting the error:

"Bummer! I am not seeing the word "Mike" in the output. Did you echo something different?"

Please help me

<?php

$name = "Mike";

echo $name;

?>

6 Answers

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,242 Points

What you're doing absolutely will work on a page and is commonly done, but here all the challenge wants you to do is create the variable and echo it. You don't need to add any html; you can just do it all inside your first set of <?php ?> tags.

Magnus Rydberg
Magnus Rydberg
4,683 Points

You seem to have added another delimiter by accident in the middle of your code.

<?php

All your php code goes here.

?>

I've tried:

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

and

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

and

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

and

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

and

I've tried:

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

and

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

and

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

and

<?php $name = "Mike" ?> <p><?php echo $name ?></p>

None of these are graded as correct. Can't progress without a correct answer...... Can we please get some help?

*Edit: For some reason it is not displaying what I wrote between some of the "ands"

<?php

$name = "Mike";

echo $name;

?>

Thank you Ryan Field My problem is solved!

Hi,

I'm getting problem with Challenge Task 2 of 2

I already make a code like below but getting the error, "Bummer! I am not seeing the word "Mike" in the output. Did you echo something different?"

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

Please help.. Thanks

Thiago Nogueira
Thiago Nogueira
8,411 Points

Try this;

<?php

$name="Mike";
 echo $name

?>

In this challenge you simply need to print the name!

Let me know if it works! :)

Hi Thiago Nogueira ,

It's work! thanks you so much..

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

Thanks

<?php

$name = "Mike";

echo $name;

?>

borisbendjemla
borisbendjemla
8,595 Points

Hi team,

i put your last code Thiago but it still doesn't works...

Message error : Bummer! I am not seeing the word "Mike" in the output. Did you echo something different?