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 Build a Simple PHP Application Creating the Menu and Footer Variables and Conditionals

challenge 3 of 4 on build a simple PHP application

challenge 3 of 4 on build a simple PHP application

index.php
<?php
$flavor = "vanilla";
echo "<p>Your favorite flavor of ice cream is ";
echo "vanilla";if ($lavour == "cookie"){echo "on"};
echo ".</p>";
echo "<p>Randy's favorite flavor is cookie dough, also!</p>";

?>

2 Answers

Grace Kelly
Grace Kelly
33,990 Points

Hi Mandava, when you post a question to the forum it's usually a good idea to describe the issue you are having, this makes it easier for us to asses what the issue is and help you reach a solution :) you can check out the video on tips for asking questions, usually on the right hand side of the page.

I looked at the code challenge and it asks you to add a conditional statement to check if your flavor is the same as Randy's favorite flavor, cookie dough, you can do this in the following way:

<?php

if($flavor === "cookie dough") {  
echo "<p>Randy's favorite flavor is cookie dough, also!</p>";
}
?>
Sjors Theuns
Sjors Theuns
6,091 Points

Hi Mandava,

like Grace mentioned and like I also said in your other question: it is better to provide info on what you want to know or what you can't figure out.

Anyway, in your other question (https://teamtreehouse.com/forum/challenge-task-4-of-4-10) there is also an answer to this challenge (3 of 4) so you can check it out.