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 Build a Simple PHP Application Integrating with PayPal Building the Shirt Details Page

jarrod Reeves
jarrod Reeves
6,357 Points

Why doesn't my shirt page look like Randy's ?

The $20 and the Mike the frog is shown down the bottom of the shirt picture and not on the right side of the photo.

Here is the shirt.php code.

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

$product_id = $_GET["id"];
$product = $products[$product_id];

$section ="shirts";
$pageTitle = $product["name"];
include("inc/header.php"); ?>   


    <div class="section page">

        <div class="wrapper">

            <div class="breadcrumb"><a href="shirts.php">Shirts</a> &gt; <?php echo $product["name"]; ?></div>  

            <div class="shirt-picture">
                <span>
                    <img src="<?php echo $product["img"]; ?>" alt="<?php echo $product["name"]; ?>
                </span>
            </div>

            <div class="shirt-details">

                <h1><span class="price">$<?php echo $product["price"]; ?><span> <?php echo $product["name"]; ?></h1>

                <p class="note-designer">*All the shirts are designed by Mike the Frog.</p>

            </div>

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

Thanks

1 Answer

Hi jarrod :) here ...

 <img src="<?php echo $product["img"]; ?>" alt="<?php echo $product["name"]; ?>

you haven't close your image tag and you are missing a ". Change it to...

 <img src="<?php echo $product["img"]; ?>" alt="<?php echo $product["name"]; ?>">

I hope this helps.

You are welcome