I have a page with a one-time database search. This page requires a payment through paypal, which will auto return them to my search page once payment is made.

The problem I have is that the page is still visible through a direct link, and I need to make it so the person can only use the search bar if they have just paid. I already have an IF section set up, but with an unused variable.

I don't know exactly where to go from here. How can I make this happen in a way that the user cannot synthesize? Reason i'm asking here is that I was told I could possibly a session in PHP, store it on the database, send it to paypal and have paypal include it in the redirect, then once it's used, delete it from the database?