Payment processing and links

Hi,
I’m trying to set up a kind of a Flash MMOG where people can purchase certain priviliges on-site. Essentially, after a successful payment made by a user with PayPal, I want to update my database with that information. But since when paying, the user opens a new window, how do I know if the user paid or cancelled?

Although PayPal allows me to indicate a page to which the user is redirected after successful payment, is there any way to make the page inaccessible any other way except through PayPal, so I can put in the PHP to modify my user database?

I know this is complicated and hard to explain, but maybe if you could point me in the right direction - a tutorial, or a technical term for what I’m trying to do…

Thank you!