Guys I’m not a programmer, I’m in the group as an enthusiast. I ask questions to find out what I don’t know and to gain "insights".
I managed to resolve the situation this way:
First I did this:
At the time of registration I sent the team(); to the country data_ts of my table.
So when the user tries to log in the code below check if the asset is 0 or 1. If it is 0 and has not passed 24 hours of the registration time I ask him to access the email to activate, if it has passed 24 hours then I delete from the table that registration:
if ($ativo != 1)
{
$tempo_agora = time();
if (($tempo_agora - $tempo_cadastro) >= 86400)
{
$excluir_cadastro = DBDrop('tabela', "email = '$email'");
//DBDrop é minha função para fazer exclusões
$erros = "Seu cadastro expirou! Após se alistar você tem até 24h
para acessar seu e-mail e ativar sua conta!
Agradecemos a compreensão!";
}
else {
$erros = "Acesse seu e-mail para validar seu cadastro!";}
}
But then I realized it didn’t solve the situation, because the user could just never try to log in, so the data would still be in the database. So I did this function (in a separate file) to put on the home page through a require:
<?php
//Exclui linhas não ativadas em até 24h
function vinte_e_quatro () {
$tempo_agora = time();
$query = DBDrop('tabela', "ativo='0' AND (data_ts + 86400) <= '$tempo_agora' ");
}
?>
Very happy with the result, thank you all for guiding me!
Hi, Gustavo, I took the liberty of editing your reply to make it more affirmative and less interrogatory. I also added links to documentation. Give a check on the guide [Answer].
– brasofilo
Thanks for answering. I don’t know how to link php and Windows task scheduler. I’ll have to study about that. Is this answer I posted valid? Works well.
– I Wanna Know
Got it! : 3 Uhu
– I Wanna Know