gpt4 book ai didi

php - 我忘记的密码是否正常工作,还是我遗漏了什么?

转载 作者:行者123 更新时间:2023-11-30 23:36:02 25 4
gpt4 key购买 nike

<分区>

当用户注册时,会有一个随机值md5(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)) 进入verified 列,直到他验证他的帐户。当这种情况发生时(通过电子邮件),verified 变为空。

当用户想再次收到他的电子邮件验证时,在文本框中输入他的电子邮件,有 4 种可能的情况:

  1. 无效的电子邮件 -> please-correct-your-email.php
  2. 有效的电子邮件 -> this-email-is-not-found.php
  3. 有效的电子邮件 + 在数据库中找到 + 已验证 -> is-already-verified.php
  4. 有效的电子邮件 + 在数据库中找到 + 尚未验证 -> still-not-verified.php

我的问题是我的逻辑和结构是否正确以及我是否忘记了什么。不过它工作正常。

if ($_POST["email"]) {

require_once('config.php');

$errflag = false;

$send2email = mysql_real_escape_string($_POST["email"]);

if (!filter_var($send2email, FILTER_VALIDATE_EMAIL)) {
$errflag = true;
}

if($errflag) {
header("location: please-correct-your-email.php");
exit();
}

$qry = "SELECT verified FROM members WHERE email='$send2email'";
$result = mysql_query($qry);
$member = mysql_fetch_assoc($result);

if($result) {
if (mysql_num_rows($result) == 0) {
header("location: this-email-is-not-found.php");
exit();
}
elseif ( (mysql_num_rows($result) > 0) && ($member['verified']) ) {
header("location: still-not-verified.php");
exit();
}
else {
header("location: is-already-verified.php");
exit();
}
}

} //this is for if post email

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com