Jonas Jonas - 3 months ago 7
HTML Question

Open website with picture (based on link)

I want to make one website (running on a Raspberry Pi) and based on the link (for example: test.com/01 or test.com/02) the exact website should be opened, but with another picture. I want to avoid a database and I would like to work with pictures. Is it possible always to open the "index.html" website and get the numbers out of the link?

Answer

test.com/01 will take you to the 01 file. What you are trying to do is pass in key-value query parameters, and need a Query string like this test.com?picture=01. You can even use the same HTML page and then choose the picture from the query string.

Since you want to avoid DBs, you can send both pictures and then hide the one that is not in the query string.

URLs are kinda complicated, check them out