Home > database >  Email authentication in raw PHP language
Email authentication in raw PHP language

Time:08-20

I have an online site that is MVC and written in raw PHP language
I have a register page which is for registration
I want to use the email authentication service
But I don't know
I would be grateful if you could send me a site or resource that is free along with the tutorial
If more details are needed, please provide them
thank you

CodePudding user response:

The Email Verification System is a reliable method for validating email addresses. In this case, you must create a token when a user registers and send it along with the application URL to the user's inbox. However, you must also store the token along with the user ID in the database so that it can be validated later.

You can validate in a variety of ways, but I personally like to create a column in the user database called is_email_verified and set its default value to 0. Then, when the user has successfully registered, I send the email. When the user clicks the verification link, I will use $_GET to get the token from the url and check it against the database. Then, using the token, I will get the user id and set the value of that users is_email_verified property to 1.

For your reference you can watch this video

https://www.youtube.com/watch?v=aCrGIFspU4A

  • Related