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 Integrating with PayPal Including the Products Array

daniwao
daniwao
13,125 Points

Shirts.php not showing up

My shirts.php is not showing up. I'm not sure what is wrong. My code looks right. Here it is below.

<?php include("inc/products.php"); ?>

<?php $pageTitle = "Mike's Full Catalog of Shirts"; $section = "shirts"; include('inc/header.php'); ?>

    <div class="section shirts page">

        <div class="wrapper">

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

            <ul class="products">
                <?php foreach($products as $product_id => $product) { 
                        echo "<li>";
                        echo '<a href="shirt.php?id=' . $product_id . '">';
                        echo '<img src="' . $product["img"] . '" alt="' . $product["name"] . '">';
                        echo "<p>View Details</p>";
                        echo "</a>";
                        echo "</li>";
                    }
                ?>
            </ul>

        </div>

    </div>

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

1 Answer

Hey man!

You may have figured this out already because this is quite late.. But if my memory serves me correctly, the shirts.php file is inside the shirts folder? If it is, you need to reference the include files which are now above the folder you're currently in. i.e. include('../inc/FILE.php')