thank you for taking the time to explain this indeapth. I apreciate it. I still am not sure exactly how to apply this, but I'm sure some experimentation will solve that.
In the meantime I decided to use a more primitive solution to the whole problem, and jsut relayed on form submits with clicking a button instead of a checkbox. wich redirects to a page, executs the queries, updates the DB and then redirects back to the original page. the page is not expected t ohavem ore then 10 thumbnails on it at any time, so even though it might seem like a bad idea, I tested it and it seems to work ok. I'll look to updating this in the future using this example.
In the meantime, I noticed you mentioned using code before the content of the page is loaded.
This is also something I'm interested in since I'm planning to restrict access to part of the webpage by a autentification mesage where the user should type in their username and password.
the way I imagined this was that when the user would try to access the first page of the restricted part of the page, a pupul would apear whenre he would be needed to type in his password. if the password is wrong he would be redirected to the last page he was on, if it's corect he can go on. also if he tryes to load a page after the first …