EDIT: I am creating a login and signup for a website. But, I am making it require a activation via email. I want to have them directed to a webpage that changed their “active” status in the database to 1 (boolean) so that they are then permitted to login. All I need now is to be able to change the value in the database
Share
Create a table activations. When user signs up, create a random hash, and store it in this table along with his new user id. Then send an email, containing an url with the hash (for example,
http://example.com/confirmation.php?hash=376728zhdif274thfj36).In your confirmation.php, you’d take the
$_GETvalue, query the database with it, and select the according user id, then run another query with the user id, in which you’d set his activation status.Creating a new hash:
Selecting the userid with the hash:
Updating the activation status with the user id from the query above: