Need help in creating a verify.php / confirm.php for my site after registration. Email is already being sent to the email of user with a confirmation link. I need the link to work like this:
When link is clicked, user will be directed to our site and will echo a simple message and update a certain column in our database that would state the user is VERIFIED from being UNVERIFIED user.
Thanks in advance!
I would go about it like this:
www.mysite.com/verify.php?email=USERS_EMAIL&token=GENERATED_TOKEN
.verify.php
you would need to check if the user exists in the DB and update that user. Example Queries:
<?php
$checkUserExists = "SELECT COUNT(username) FROM users WHERE email = USERS_EMAIL"; //This should return a 1 if the user exists.
$updateUser = "UPDATE users SET verified = 1 WHERE email = USERS_EMAIL AND token = GENERATED_TOKEN"; //Update the user if he exists.
?>
Hope this kinda helped you out on how to approach this. Please write your own code or post up what you have tried, as it was said in the comments, we are more than willing to help out but we won't do all the work you have to do.