samedi 28 juillet 2018

Load content from database depending on link clicked

I'm new to PHP and trying to get to grips with the basics. I have a list of "items" stored in mySQL for my online shop website. The front page is a list of all the items, each with a thumbnail, title and short description.

When the user clicks on an item, I want them to be sent to a page with the full description, cost and other information, all on its own page.

I understand that this is to be done with a "get" request, but when i look at other peoples examples, it seems that the information append to the URI is descriptive, rather tan unique.

I'm assuming that the user clicks the thumbnail item from the list, and than a new templated page loads, and retrieves data from the database using the information attached to the URI as an identifier. Is this how it works? If so, how do online shops make their URI's so readable, and still manage to ensure that the attached data can uniquely identify an item?

Any code examples would be really appreciated.




Aucun commentaire:

Enregistrer un commentaire