Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

including the header

I am having trouble getting the shirts and contact page to link in my shirts 4 mike project. I'm pretty sure that I have all the code the way it's done in the video.

<html>
<head>
    <title><?php echo $pageTitle; ?></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.php">Shirts</a></li>
                <li class="contact"><a href="Contact.php">Contact</a></li>
                <li class="cart"><a href="#">Shopping Cart</a></li>
            </ul>

        </div>

    </div>

    <div id="content">

It worked just the other day, although I couldn't get the underline to take effect on the links. any suggestions would be appreciated

5 Answers

sorry, I forgot to mention, the code above is for my header.php file

Stone Preston
Stone Preston
42,016 Points

are you sure you named your files with capital letters? shirts.php instead of Shirts.php etc?

yeah, I named my files with capital letters, so it is supposed to be Shirts.php and Contact.php. it shouldn't make a difference as long as I type it the same as I named it, right?

Holger Liesegang
Holger Liesegang
50,595 Points

Hi Aaron, and "Contact.php" and "Shirts.php", exactly written the same, are in your root directory "./" and I assume that the link

<a href="./">Shirts 4 Mike</a>

works for you? Kind Regards Holger

Contact.php and Shirts.php are in my htdocs folder, which is the root directory, right? I think the problem is that my index.php won't pull up the site. If index.php doesn't work, then Header.php won't work. Contact.php and Shirts.php are in the Header.php file which explains why they don't work either. index.html does pull up the site, but the links don't work. thanks for your help.

Aaron