I have a grocery store web page index.html with a navigation to different product categories (Fruits, Meats, Snacks etc...), then I have a page named aisle.php which will display all of the products from the category, and it gets all of the products from a json file. I'm wondering how do I redirect to the aisle.php page and load the products I want, since I need to know which link was clicked. I'm new to php and json and it's what we are required to use for our class, thanks in advance!
you can form your link to aisle.php with a parameter in query string like so :
<a href='aisle.php?content=Meats'></a>
and in aisle.php your can check the parameters via $_GET variable and show the products you need
There are several ways of doing this :
Once your variable is sent, you can save it into a SESSION or a COOKIE.
I suggest you read about PHP superglobals