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

Edmund lok
PLUS
Edmund lok
Courses Plus Student 6,465 Points

Confusing in Task 4.

When i edit $flavor = "vanilla"; to $flavor = "cookie dough"; the system keep ask me to redo task 2. how it works?

2 Answers

geoffrey
geoffrey
28,736 Points

Instead of replacing the value directly inside the original variable, try to rewrite the variable and the new value.

            <?php
          $flavor = "vanilla"; 
          $flavor = "cookie dough";
    ?>

I've experienced a similar issue with another exercise. And doing it solved the problem, even if doing what you did isn't a mistake.

Shawn Stewart
Shawn Stewart
7,746 Points

You do need to change vanilla to cookie dough. I was stuck on this one for about 15 minutes because it kept throwing errors. I had to start over and it accepted the answer. If it helps, my final code is:

<?php
$flavor = "cookie dough";
echo "<p>Your favorite flavor of ice cream is ";
echo $flavor;
echo ".</p>";

if ($flavor == "cookie dough") {
    echo "<p>Randys favorite flavor is ".$flavor.", also!</p>";
}
?>