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 Item Details and Redirection

Daniel Harrison
Daniel Harrison
2,944 Points

Syntax Error

with this code

16 if (!isset($item)) { 17 header("location:catalog.php"); 18 exit; }

getting this error Parse error: syntax error, unexpected 'location' (T_STRING), expecting ']' in /home/treehouse/workspace/details.php on line 17

2 Answers

Samy Basset
Samy Basset
11,862 Points

Hey Daniel, maybe a stupid question but you're sure that you dont have the line numbers between your code right? The 16, 17, 18 part. When I copy your exact code everything works fine.

Daniel Harrison
Daniel Harrison
2,944 Points

You were right Sammy. The problem was in a previous code line. Thanks