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 Footer and Adding Additional Pages

Mohammed Ali Zaheer
Mohammed Ali Zaheer
11,787 Points

shirts.php

after writing code into shirts.php, the menu gives an error of URL localthost/shrits.php not found....please helpppp!!!

Can you post the code of .htaccess and shirts.php?

5 Answers

Don Shipley
Don Shipley
19,488 Points

Sorry I made an error, If your shirts.php is inside of your inc folder, you are calling for the link in your index.php, you do not need to go up one directory. The link would be <a href="inc/shirts.php> Shirts</a>. Looking back on my files the shirts.php and contact.php are saved in the main folder along with the index.php if you move your files shirts.php and contact.php to be in the same directory as your index.php your links will work as they are without making any changes.

Sorry for the previous error on my part.

Mohammed Ali Zaheer
Mohammed Ali Zaheer
11,787 Points

yeah you are write..its working now ..thanks man :)

Mohammed Ali Zaheer
Mohammed Ali Zaheer
11,787 Points

<?php include('inc/header.php'); ?>

<div class="section page">

    <h1>Mike&rsquo;s Full Catalog of Shirts</h1>

</div>

<?php include('inc/footer.php'); ?>

The content of header.php please, and the .htaccess

Mohammed Ali Zaheer
Mohammed Ali Zaheer
11,787 Points

<html> <head> <title><?php echo " Shirts 4 Mike"; ?>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.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">

what is .htaccess?

Don Shipley
Don Shipley
19,488 Points

Are your saving the shirts.php inside the root directory or inside the inc folder?

Mohammed Ali Zaheer
Mohammed Ali Zaheer
11,787 Points

in inc folder as illustrated in a video..

Don Shipley
Don Shipley
19,488 Points

Do not remember the video but the index file would be in the root folder, In that case your link would work. Inside the inc folder you would need to add ../shirts.php adding the ../ to go up one directory. Try placing the shirts.php inside the same location as your index.php Then your link should work..