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
Cyrus Ghazanfar
4,549 Points'including header' php
Hello,
In the 'including header' video in the PHP section, i followed all the guidelines however when i click on contact on my Shirts 4 Mike website nothing changes. The link in the browser becomes localhost/# where it should be localhost/contact.php.
what is wrong?
3 Answers
Elliott Frazier
Courses Plus Student 9,647 PointsIn order for us to help we'll need to view the code you have thus far.
Cyrus Ghazanfar
4,549 PointsHello Elliott,
how could I show you all my codes in the different files?
Nora Demirjian
7,160 PointsI think you have to update the navigation menu. Replace # with contact.php.
You can 'View Page Source' in your browser and copy/paste it here for us to see.
Cyrus Ghazanfar
4,549 PointsThanks Nora, it works when i put contact.php. However i cannot navigate between the contact page and mane page, to do so i'll have to write "contact.php" or "shirts.php" to go to those specific pages. I don't get why it doesn't load another page just by clicking on it...
here is my source code from the contact page:
<html> <head> <title>Shirts 4 Mike</title> <link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Oswald:400,700" type="text/css"> <link rel="shortcut icon" href="favicon.ico"> </head> <body>
<div class="header">
<div class="wrapper">
<h1 class="branding-title"><a href="./">Shirts 4 Mike</a></h1>
<ul class="nav">
<li class="shirts"><a href="#">Shirts</a></li>
<li class="contact"><a href="#">Contact</a></li>
<li class="cart"><a href="#">Shopping Cart</a></li>
</ul>
</div>
</div>
<div id="content">
<div class="section page">
<h1>Contact</h1>
</div>
</div>
<div class="footer">
<div class="wrapper">
<ul>
<li><a href="http://twitter.com/treehouse">Twitter</a></li>
<li><a href="https://www.facebook.com/TeamTreehouse">Facebook</a></li>
</ul>
<p>©2013 Shirts 4 Mike</p>
</div>
</div>
</body> </html>
Matt Campbell
9,767 PointsWhere you have the href in your navigation menu, the href is the hypertext reference, as in it refers to something, in this case another page. These are basically pointing at what you want to load when you click it.
So, you need to actually put a link in there.
Have you done the HTML course as this is basic HTML and covered at the start of the HTML course. You should have done HTML, CSS and jQuery before even looking at PHP. PHP code will output HTML at the end of the day. Without understanding HTML, you'll get stuck often over basic things such as this.
Cyrus Ghazanfar
4,549 PointsWell i did exactly what the video showed and there was no href link put into the header. I was surprised too...
Michael O'Malley
4,293 PointsAt 2:13 into the "Including the Header" video he changes;
<li class="contact"><a href="#">Contact</a></li>
To;
<li class="contact"><a href="contact.php">Contact</a></li>
And if the contact.php file is in the same directory as the index.php -- it should work. :)