This question has already been answered:

The user makes an application and is registered at the same time, but he must make a confirmation by mail, the application is added to the database as a pending confirmation. if the user did not confirm then the application should be automatically deleted every other day. (the site I write in PHP without frameworks)

Reported as a duplicate by Akina , 0xdb , Andrei NOP , Grundy , Eugene Krivenja 14 May '18 at 11:56 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • Somewhere on Habré there is an article about the types of storage uchetok. There are many ways. - nick_n_a
  • The application is stored in the DBMS right? Put a sign - the date "expired", if the date is and has come - delete. - nick_n_a
  • What database is used? Maybe it has a TTL mechanism. Then it will be enough to put it on day 1, and after confirming it will be set to 0 (forever, for example) - Chubatiy
  • MySQL is used, but it looks like TTL - Nurtileu Aliyas

1 answer 1

You do not need to delete a request , you simply create a request and specify the date to which it is active, when you click on the link, first the date is checked and if the time has not expired, the account is activated and only then the link is deleted, otherwise a message is displayed that the link is outdated and the offer create a new link, when the user creates a new link, then you update it with a new one as the date.

  • If you are going to make an event of the type to delete by time, you need to set up cron or similar mechanisms that will track, and this is superfluous when everything is done much easier! - RifmaMan
  • So, I want to delete the application after the time expires, because no one sees or clicks on it (if I understood your answer correctly), and read about crowns and demons, but I didn’t understand how to implement it (I would be grateful if you Some links were thrown, but it seems to me that I’m not even looking for it right :)) - Nurtileu Aliyas
  • The point is just not to resort to the krone mechanism, why load the server unnecessarily with unnecessary tasks and waste resources on it, and the link should not be cleaned, let it hang, it’s more accurate to keep the hash until it is accessed, and if you never do this, then nothing will be scary, this method of implementation is used everywhere, but what you want to do through kroner is an extra and meaningless load on the server !!! - RifmaMan
  • You just generate some hetsh and write it to the user’s field in the database, for example: OVsZ4DNa and the path will be like this: http://temp.ru/activate?user_id=11&hash=OVsZ4DNa - RifmaMan
  • but I’ve already added a whole application to the database with several fields and photos, it just waits for activations, it’s about being deleted as if it is not activated - Nurtileu Aliyas