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 trialMyroslav Tkachenko
10,581 PointsPHP 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.
18 Answers
William LaMorie
11,769 PointsFor anyone still wondering, it is in fact fixed at this time.
Andrew Shook
31,709 PointsMyroslav, 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
49,309 PointsI've got same problem. this make me crazy.
William LaMorie
11,769 PointsJust 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
28,766 PointsOMG Hampton Paulk This has been driving me crazy! I thought it was me!!!
Myroslav Tkachenko
10,581 PointsGot 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."
rosinapissaco
13,401 PointsThey say the same all the time.
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
23,692 PointsMaja, 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
49,309 PointsIt work!
but i think there is something treehouse need to do
Maja B.
12,984 PointsOK, passed!!! Thank you Craig!!!
Lonnie Wibberding
18,318 PointsPerhaps 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
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
49,309 PointsI send a message to treehouse and got an answer
They promised to fix this very soon
Yousuf Tafhim
8,402 PointsTry now. I think the code editor was not working for last few days. :)
William LaMorie
11,769 Pointsthe code editor has been working fine for other classes, and it still returns the same error message for this assignment.
Yousuf Tafhim
8,402 PointsYes you are right. It is still not working.
Craig Garrity
23,692 PointsHas 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
11,769 PointsI 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
10,581 PointsI 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.
rosinapissaco
13,401 PointsWhen they will fix it!!!! ????
Maja B.
12,984 PointsHi, I have the same problem. Hopefully they will be able to fix it soon. Nice day to all, Maja
Tony Brackins
28,766 PointsPunal Chotrani
8,817 PointsOk.. 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
39,278 PointsYes, 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
28,766 PointsI know. They probably should have a status page or something...
Agustin Grube
39,278 PointsAll fixed. I retook the challenges and I passed them all.
Edwin Muswere
9,061 PointsFinally, 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
Jason Anello
Courses Plus Student 94,610 PointsIn your if
condition you forgot the $
on name
Should be if ($name == "Mike")
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsI tried different things too. double quotes, triple equals, .... None of it should really make a difference.
Tagging Hampton Paulk