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 Including the Header

Contact.php link not working

While doing this exercise, after following all steps clicking "CONTACT" in the header merely redirects the website to localhost/# as if I had never updated the href.

Any ideas on what may be happening? Can confirm that in the header portion it reads: <a href="contact.php"

3 Answers

Andrew Dushane
Andrew Dushane
9,264 Points

Is this when you click on the link from the homepage (index.php)? Are you including the header on that page or do you still have the code in the file? If you use dev tools/Inspect Element in Chrome (or Firebug in Firefox) does it show the correct link? You could always download the project files from the next phase and compare your code to the final version.

geoffrey
geoffrey
28,736 Points

Would you mind posting your code ? I'd like to see it to try to help you.

That might sound stupid as suggestions but have you reloaded the page with F5 in the browser once you saved the updated link ? Are you sure you are not saving a file named the same way, in another folder ?

(Once again, It might sounds stupid but these are things that 've already happened to me, when I was doing some tests and I was very tired).

But normally yes, doing that as you stated, at this stage, is the way to do.

Yes, this happens when clicking from the homepage. The header.php is brought in through the include command.

The problem is now fixed, and I honestly couldn't explain to you why. I changed none of the code. Merely restarted the server and computer. Thanks for the quick responses guys! I appreciate it.