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

Daniel Schwemmlein
Daniel Schwemmlein
4,960 Points

always gives me an error when I try to create my if statement

It asks me to create a variable called $name and set it equal to 'Mike', easy enough. Then it asks me to create an if statement to test if the string for the variable is really mike. So I put if ( $name == 'Mike' ) { echo "my name is mike";} Always marks it as wrong. Any ideas anyone?

6 Answers

Shawn Flanigan
PLUS
Shawn Flanigan
Courses Plus Student 15,815 Points

Daniel,

Pretty sure that code challenge is broken. A few people were trying to get past that same question this weekend and nobody could seem to get it to work. I tried, too, to no avail. Not sure who to send this issue to, though.

Your syntax looks correct. :)

Edit: Just contacted Treehouse about the apparent bug. Will let you know if I hear back.

Shawn Flanigan
Shawn Flanigan
Courses Plus Student 15,815 Points

Already got an email back from Treehouse support (they're quick!):

"Thanks for contacting us about this. We're aware of this and it's being investigated. A fix should be rolled out by the end of the day. We apologize for any inconvenience that this may have caused you!"

Sometimes Treehouse wants to the spelling of strings such as "My name is Mike" to match exactly, including capitalization and punctuation.

Did you make sure your string matches exactly?

William LaMorie
William LaMorie
11,769 Points

The Treehouse instructions ask for nothing other then checking the conditional in an if statement, they don't want anything echoed out, and the variable they want has to be checked for the previous step.

I received an email from Treehouse today saying this had been fixed, checked, and it has not been. Not a big deal, as it's not a part of a course track, but I hope it gets resolved soon.

Has this issue been resolved, tried about a 10 variations.

It still seems to be down.

William LaMorie
William LaMorie
11,769 Points

this has been fixed at this time! =)

How so?

I'm still having trouble with it! :/

Shawn Flanigan
Shawn Flanigan
Courses Plus Student 15,815 Points

Ruud,

It was working last I checked. If you post your code I'll be happy to take a look.

Mathew Thomas
Mathew Thomas
15,368 Points

It's still not working. Thought I was going mad!

Shawn Flanigan
Shawn Flanigan
Courses Plus Student 15,815 Points

Matthew,

I just checked it out and it seems to be working fine now. Which task is giving you trouble?