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 trialSimon Tucker
9,113 Pointshaving trouble displaying the image in shirt.php it is passing through ok with the alt attribute displaying.
shits4mike example
Simon Tucker
9,113 Points?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> > <?php echo $product["name"];?></div>
<div class="shirt-picture">
<span>
<img scr="<?php echo $product ["img"]; ?>" alt="<?php echo $product["name"]; ?>">
</span>
</div>
</div>
</div>
<?php include("inc/footer.php"); ?>
Christopher Bijalba
12,446 Pointshi ,
you have a typo:
<img scr="<?php echo $product ["img"]; ?>" alt="<?php echo $product["name"]; ?>">
should begin <img src
also, you need to have no space between $product and ["img"] it should be $product["img"]
Simon Tucker
9,113 PointsCheers I have been looking at this for to long, I must need some sleep. Cheers.
1 Answer
Christopher Bijalba
12,446 Pointshaha - no problem, I know its addicting to go through all of these. Give me a correct answer if you will :}
Christopher Bijalba
12,446 PointsChristopher Bijalba
12,446 PointsHi - show the code in your <div class="shirt-picture">
here is mine (split up for legibility), but it is from a later chapter where the URLs are cleaned up.