Hello Community,
I was wondering if it is possible to run a php file every week that checks if a user has activated there account after 7 days they will be deleted.

Please help.

Thanks in advance.

Use the Cron Job on Cpanel.

Yes i thought of that, but how?

you write a script that queries your database for "if a user has activated there account after 7 days", if not "delete".

so basically, if you run the script directly, it does that - check and delete.

what you might want to do it for the script to run automatically, once a day for example. Open up cron job and you should find once a day in the "common settings".

As for the command, it should be something like this - "php /home/cashrun/public_html/joshl/check_delete_unactivated.php" - whenever the script is located.

What does "PHP -f" mean

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.