View Full Version : Automated System (probably with a bot)

02-22-2007, 04:10 AM

I want to make an automated system that checks itself every day at like 1 in the morning. It will go through all the accounts in my database and check the expiration date on each one, and like if there is 7 days left, send an email, 1 day left send a different email, etc. I know how to right a PHP script for this, but I don't want to have to have anyone browse that page in order for it to work, I want it to be self-sufficient. I think it would be best to make this a secure page with a encrypted login and I would need to run a bot of some sort that would access that page and would put the password in and run the script. This is a totally different environment for me, so I'm unsure as to what the solution would be. Does anyone know of a bot that does this already? What language does this bot need to be in? Do I need to code some sort of software or an application using Java or something? Input is needed! Thanks in advance!

02-22-2007, 08:26 AM
you just need to write a script in the language of your choice & run it automatically from cron, cron is like the task scheduler on windows and you can set it to run at set intervals, the cron script would call your (e.g.) PHP script as a cgi....

php -q -f /home/user/dbcheck.php &2>1

the added advantage there is that no-one else can run your script from a browser etc.
All this depends of course on your host supporting cron jobs, but almost all do, if yours does not ? then get another host ;)