2014-10-11 15:12
浏览 70


I want to make a script in php like given below:

  1. When any user registers on my site.

  2. A mail will be sent, before continue with the registration to ignore SPAM.

  3. User will get an email to verify their email address and continue with their registration (Same as Stackoverflow)

How can I achieve this? Please guys help me with any (STEP BY STEP) Script / Tutorial / Suggestions / Knowledge.

图片转代码服务由CSDN问答提供 功能建议


    \ n
  1. 当任何用户在我的网站上注册时。

  2. 在继续注册以忽略垃圾邮件之前,将发送邮件。

  3. 用户将收到一封电子邮件,以验证其电子邮件地址并继续注册(与Stackoverflow相同) < / ol>

    我怎样才能做到这一点? 请大家帮我解决任何(逐步)脚本/教程/建议/知识。

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • donglei1699 2014-10-11 15:33

    To achieve this verification process, you have to set up a PHP site logic which allows you to enter your credentials, then generate a confirmation hash, create a link such as and send it along with the email (SMTP). You also set a variable (e.g. bool/tinyint "active") to 0 so the user can't log in until he activated the account. You'll also need kind of a database to store the credentials and hashes and other parameters.

    On the other hand you have to build a "activate.php". When the user receives the email, he should have a link which contains username and hash and redirects to the activation site. The site $_GETs the parameters (here named user and hash) and fills them into a textbox each. Then the user has to click on "activate", "active" gets set to 1. Then the user is able to log in.

    There are dozens of tutorials on youtube, just search there.

    Examples: or

    解决 无用
    打赏 举报

相关推荐 更多相似问题