Validate a code to send to a 1 time URL

What I would like to do is have a user send me an application for an account, a system which I have in place and is working. Once I receive and review the application I will email a code to them. The user would then enter the code on a page, be redirected to a one-time URL, and create a user.
What I don’t know how to do is validate the code with my database, if the code is good, redirect to a one-time url? Any help very much welcomed!

Hi there,

Assuming the accounts are stored in some kind of database - add a status column so that each user is either pending or verified and then use either another column that stores a random hash code or their entry id. They can then go to a page such as activation.php?uid=[id/code of pending user]. You can then pull in the get variable, find that user, check their current status is pending and activate them.

Hopefully that makes some sense and is relevant to the goal you are trying to achieve!

Sponsor our Newsletter | Privacy Policy | Terms of Service