verify a user via e-mail in PHP

前端 未结 3 2066
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-15 00:21

I\'m actually creating a web application using PHP and seek help verifying a user. As with certain websites, when you register, an e-mail is sent to you with a confirmation

3条回答
  •  情书的邮戳
    2021-01-15 00:52

    Patricks answer is correct altough i want to point out that there are other possibilities!

    You don't necessarily have to create and store a unique token in your database. This is data overhead that is only needed once.

    You could also take advantage of one-way hashing.

    For example send the user the code md5('my-secret-application-token'.$user_email_adress).

    You can validate that just the same way but dont need to store a secret code.

提交回复
热议问题