Welcome to the Treehouse Community
Looking to learn something new?
Where does the product_id come from?
For this php code on the shirts.php page:
$product_id = $_GET["id"]; $product = $products[$product_id];
Are we getting the $product_id variable from the URL of the page? Since this page is directing us to "shirt.php?id=102" that means it's getting the id # 102 from the URL bar, not from products.php?
Kazimierz Matan13,257 Points
$_GET is an array of values passed by URL (GET method of a form). We get a value of "id" (for instance "102") and then we retrieve from $products array a product with $product_id equal to 102.
Thanks Kazimierz! That helps a lot.