bapperlo
asked on
auto script
Is it possible to create a php-script that runs at a specific time, for example at midnight. I need some sort of script that checks a database and when it finds a record with the date of that day, then a mail must be send at the person who is responsible for the record.
Hi,
Yes it is possible you will need to create a script that has no output(this is the best choice), if you do want to output stuff put it in a db or mail it with the mail() function. And then run it with a standalone php binary on the webserver. This is the tricky part not all webservers have this and i do not know if this is possible on windows. On a linux box it is quite simple, on the php site there is a tuturial for this. and than put it in the cron off your linux box. if you do not know how to do this contact your ISP.
--
Greetz
Robert
The Netherlands
Yes it is possible you will need to create a script that has no output(this is the best choice), if you do want to output stuff put it in a db or mail it with the mail() function. And then run it with a standalone php binary on the webserver. This is the tricky part not all webservers have this and i do not know if this is possible on windows. On a linux box it is quite simple, on the php site there is a tuturial for this. and than put it in the cron off your linux box. if you do not know how to do this contact your ISP.
--
Greetz
Robert
The Netherlands
the other solution is to use lynx with a cron job:
* 10 * * * /usr/bin/lynx http://www.domain.com/file.php
* 10 * * * /usr/bin/lynx http://www.domain.com/file.php
the other solution is to use lynx with a cron job:
* 10 * * * /usr/bin/lynx http://www.domain.com/file.php
* 10 * * * /usr/bin/lynx http://www.domain.com/file.php
or my RobotOuaibe program, who launches URIs at specified time of each day. I use it all the time. It's free and 200KB See www.edainworks.com
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.php.net/manual/en/features.commandline.php
then use some cron jobs:
http://campuscgi.princeton.edu/man?crontab