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 Conditionals & Loops Conditionals Challenge

Myroslav Tkachenko
Myroslav Tkachenko
10,581 Points

PHP Basics, if/else statements, Challenge Task 2 of 3: can't pass, seems that the code checking script is broken

It always returns 'Bummer! I cannot see your 'if' statement'. My code is:

<?php
  $name = 'Mike';
  if( $name == 'Mike' ){
  }
?>

The task is to write an if statrment that checks if the variable $name is set to the string 'Mike'. Any ideas or suggestions how the code must be written to pass this challenge? Thanks in advance.

I tried different things too. double quotes, triple equals, .... None of it should really make a difference.

Tagging Hampton Paulk

18 Answers

William LaMorie
William LaMorie
11,769 Points

For anyone still wondering, it is in fact fixed at this time.

Andrew Shook
Andrew Shook
31,709 Points

Myroslav, I tried to give the code challenge a go too, and got the same error. I think there is a bug in the system. Try contacting support. The link is in the right hand side bar at the bottom.

Jong Kun Baeck
Jong Kun Baeck
49,309 Points

I've got same problem. this make me crazy.

William LaMorie
William LaMorie
11,769 Points

Just an update - The final code challenge for the assignment also seems to have an issue with it, I skipped past and encountered a very similar message there.

Tony Brackins
Tony Brackins
28,766 Points

OMG Hampton Paulk This has been driving me crazy! I thought it was me!!!

Myroslav Tkachenko
Myroslav Tkachenko
10,581 Points

Got an update here, think you all may be interested ;) - a letter from the support team!

"Hello, We're working on the PHP challenges and should have a final solution in place quickly."

They say the same all the time.

Maja B.
Maja B.
12,984 Points
$name = 'Mike';
if ($name == 'Mike'){
echo "Hi, I am $name";
};

Hi, is that the solution to the 3rd task?

Craig Garrity
Craig Garrity
23,692 Points

Maja, you just need to insert the statement exactly as it is listed in the challenge. So if you replace the line with $name with "Hi, I am Mike!" that should complete it.

Jong Kun Baeck
Jong Kun Baeck
49,309 Points

It work!

but i think there is something treehouse need to do

Maja B.
Maja B.
12,984 Points

OK, passed!!! Thank you Craig!!!

Perhaps the code only expects double-quotes instead of single-quotes. If I remember right I had this problem with the PHP courses before.

Jong Kun Baeck
Jong Kun Baeck
49,309 Points

<?php $name = 'Mike'; if ($name == "Mike") {

} ?>

no help with double-quotes it said that I can not see your 'if' statement

what was I wrong?

I got same problem with "foreach" question. it makes me feel idiot.

Jong Kun Baeck
Jong Kun Baeck
49,309 Points

I send a message to treehouse and got an answer

They promised to fix this very soon

Yousuf Tafhim
Yousuf Tafhim
8,402 Points

Try now. I think the code editor was not working for last few days. :)

William LaMorie
William LaMorie
11,769 Points

the code editor has been working fine for other classes, and it still returns the same error message for this assignment.

Yousuf Tafhim
Yousuf Tafhim
8,402 Points

Yes you are right. It is still not working.

Craig Garrity
Craig Garrity
23,692 Points

Has there been any update on this course/code challenge issue? I've just tried my code and it is not accepting it (does not mean my code is correct though!)

<?php
$name = "Mike";
if( $name == "Mike" ){
  echo "my name is Mike";
}
?>
William LaMorie
William LaMorie
11,769 Points

I received an email claiming that the problem had been correct, and I tired again, and it persisted. I replied to Treehouse that they either still have an issue or need to expand the instructions, and I have not heard back at this time.

Myroslav Tkachenko
Myroslav Tkachenko
10,581 Points

I contacted the support 4 days ago, got a response from them that the code challenges are working, but they are not :) So I sent a ticket to the support team again two days ago, no updates since then.

When they will fix it!!!! ????

Maja B.
Maja B.
12,984 Points

Hi, I have the same problem. Hopefully they will be able to fix it soon. Nice day to all, Maja

Punal Chotrani
Punal Chotrani
8,817 Points

Ok.. I'm glad to see others are having the same issue. I have been trying to get past this challenge for good 2 hours now before i googled this. Please team treehouse, could you get this issue rectified. This is my code.

<?php $name = "Mike"; if( $name == "Mike" ){ echo "my name is Mike"; } ?>

Agustin Grube
Agustin Grube
39,278 Points

Yes, I also spent 2 hours trying to complete a 20 min lesson. I also thought it was me. I emailed them this morning about this.

Tony Brackins
Tony Brackins
28,766 Points

I know. They probably should have a status page or something...

Agustin Grube
Agustin Grube
39,278 Points

All fixed. I retook the challenges and I passed them all.

Finally, echo the following string inside of the if statement: 'Hi, I am Mike!'

<?php $name = "Mike"; if(name == "Mike") { $info = "Hi, I am Mike!"; } ?>

please help

In your if condition you forgot the $ on name

Should be if ($name == "Mike")