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 trialAndrew McCombs
4,309 PointsParse error: syntax error, unexpected end of file in C:\xampp\htdocs\shirts.php on line 30 - I cant see My Problem
<?php
$products = array();
$products[101] = "Logo Shirt, Red";
$products[102] = "Mike the Frog Shirt, Black";
$products[103] = "Mike the Frog Shirt, Blue";
$products[104] = "Logo Shirt, Green";
?>
<?php
$pageTitle = "Full Catalog Page";
$section = "shirts";
include('inc/header.php');
?>
<div class="section page">
<h1>Mike’s Full Catalog Page</h1>
<ul>
<?php foreach($products as $product); { ?>
<li><?php echo $product; ?></li>
<li>Mike the Frog Shirt, Black</li>
<li>Mike the Frog Shirt, Blue</li>
</ul>
</div>
<?php include('inc/footer.php'); ?>
3 Answers
Dai Phong
20,395 PointsI see you don't close the foreach loop, and you place a wrong ";" after foreach loop.
Andrew Dushane
9,264 PointsYou're missing a closing curly brace for your foreach loop.
<li><?php echo $product; ?></li>
<?php } ?>
I'm assuming you'll want to take out the two static li items as well.
Andrew McCombs
4,309 PointsThank you!! I have been staring at this like crazy.
Sometimes you just need a new set of eye to catch it!!