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 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