I'm looking for the easiest and most sensible way to allow this scenario to occur;
User loads page --> While page is loaded it continuously queries a database until it finds a certain value is set (the users IP address) --> Once that value is set it will redirect the page.
The reason why I can't simply take the users IP on the page, insert it into the database and then redirect is because the IP address is used for a method of validation, and is passed through as a parameter to a seperate website (that I have no control over), then once the user has completed a set of actions on that website it is passed back and added into my database.
If anyone could point me in the write direction, of which PHP functions I could use and such, I would greatly appreciate it :)!