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

Help!

The following is code from my php file:

<ul class="nav"> <li class="shirts <?php if ($section == "shirts") {echo "on";} ?><a href="shirts.php">Shirts</a></li> <li class="contact <?php if ($section == "contact") {echo "on";} ?>"><a href="contact.php">Contact</a></li> <li class="cart <?php if ($section == "cart") {echo "on";} ?>"><a href="#">Shopping Cart</a></li> </ul>

I do not know why the links at the top are very buugy fi anyone spots something that would be most helpful, B.T.W: The problem is in the homepage a lot of errors come up saying:

otice: Undefined variable: section in C:\wamp\www\inc\header.php on line 17 Call Stack #TimeMemoryFunctionLocation 10.0003245056{main}( )..\index.php:0 20.0005248960include( 'C:\wamp\www\inc\header.php' )..\index.php:3

Notice: Undefined variable: section in C:\wamp\www\inc\header.php on line 18 Call Stack #TimeMemoryFunctionLocation 10.0003245056{main}( )..\index.php:0 20.0005248960include( 'C:\wamp\www\inc\header.php' )..\index.php:3 ">

Notice: Undefined variable: section in C:\wamp\www\inc\header.php on line 19 Call Stack #TimeMemoryFunctionLocation 10.0003245056{main}( )..\index.php:0 20.0005248960include( 'C:\wamp\www\inc\header.php' )..\index.php:3 ">

Kind Regards , Louis

Your code does not seem to have been uploaded.

1 Answer

The errors are stating you have undefined variables in your header.php file on line 17, 18 & 19. You need to look at those three lines and compare your code to the project file code to see what might be different. If you upload your header.php code I can take a closer look.