我想让每个用户的注册时间都很少。因此,基本上,我想在有人注册帐户时做到这一点,然后让他们说5分钟,然后再重新注册(同一用户)。
我尝试过这样的事情。
$now = date('Y-m-d H:i:s');
if ($stmt->num_rows > 0) {
exit('user already exists');
} else {
$expire = date('Y-m-d H:i:s',+30);
if($now>$expire) {
create new acc
} else {
exit('You need to wait.');
}
但是它似乎没有用
Just add "+ 5 min to expire" docs: https://www.php.net/manual/de/function.strtotime.php
您基本上可以使用此代码,它将起作用