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 Basic PHP Website (2018) Listing and Sorting Inventory Items Breadcrumbs

Alvin Hue
Alvin Hue
4,496 Points

catalog.php view details

When I am on the catalog.php page, when I clicked the individual items it didn't direct me to details.php page, I think it will be more practical to make this works, the problem is I don't know how to do it, anyone can help? Thanks!

Brian Patterson
Brian Patterson
19,588 Points

I have the same question. Did I miss something. If you click "view details" it does not direct you to the details.

2 Answers

The full output for get_item_html() should look like this:

$output = 
    "<li><a href='"
    . 'details.php?id='
    . $id
    . "'><img src='"
    . $item['img']
    . "' alt='"
    . $item['title']
    . "' />"
    . "<p>View Details</p>"
    . "</a></li>";

That's working for me!

Brad Barnes
Brad Barnes
2,761 Points

I'm having this problem too, and I have updated the functions.php page with the teacher's notes. So when I click on the links for details nothing happens