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!

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


Issue on Task 11 of PHP Creating the Menu and Footer

In the "Build a Simple PHP Application" project, "Creating the Menu and Footer," Task 11, the code challenge asks you to do two things: in question 3, you change add a conditional that makes a message appear/disappear depending on $flavor variable setting; in question 4, you are asked to change the $flavor variable so that the message appears. This, however, makes the the previous task incomplete. In short, you cannot complete both question 3 and question 4 so the section can't be completed. Or am I missing something?

Kira Gade
Kira Gade
5,711 Points

Hi I am having the same problem, did you find a solution?

4 Answers

Here's what it's asking you to do:

In Step #3, you add an if-block that checks the value of $flavor. If $flavor is equal to a certain flavor, then a message appears.

In Step #4, you change the value of $flavor to the value of the other flavor that you put into the if-block conditional in Step #3. If you did everything right, then the message in the if-block should echo out to the page.

Did that help? Or am I missing something completely?

No I think that's right--the problem seems to be that the $flavor variable in Task 3 required it to be set to "vanilla" while the $flavor value in Task 4 requires it to be set to "cookie dough". The result is, like you say, that the if-block conditional does not echo the message out for Task 3, but does echo it out in Task 4. But this means Task 3 is no longer passing, which is the error message I get. Then, when fixing Task 3, you undo Task 4. And so on.

Treehouse rules require (for good reason, I think) that, when you do code challenges, all of your tasks need to be preserved in order to continue.... and this one is asking for opposing things (both "cookie dough" and not "cookie dough").

I am having the same issue. Spent 20 minutes trying to work around it with no luck.

OK, I found the solution. After you correct the $flavor value in step 4 you HAVE to hit preview, then refresh to view the end result before you hit submit. It will then let you proceed and give you the badge. I hit refresh twice just for good measure ;)