我想要这样的功能,
用户将注册到站点并可以访问 24 小时,然后我需要使他们的帐户过期并发送邮件,因为您无法访问更长时间。
是否可以使用 cron 或没有 cron?如何?
Write the portion of your app that would allow users to register. Once they register, track the date they registered in your MySQL DB. Have a cronjob running every hour to check for accounts that have been registered for 24 hours.
Every account that you find in the DB that has been registered for 24 hours should receive the email you mention via the mail() function.
Once you send the email, set a flag on the account so the next time they attempt to login, they get an error message rather than being able to access the account.