Posted by Colin McKinnon on 09/07/06 22:15
Francois Bonzon wrote:
> On 2006-09-07 14:32:49 +0200, "giangiammy" <giangiammy@gmail.com> said:
>
>> I don't know if this is possible, but I need to accomplish an action
>> at a given hour (what cron does): is it possible to do something like
>> this having a web hosting service with php support?
>
> Yes, if you are able to set cron jobs on your web server. Save your
> script in a PHP file like
>
>
> #!/usr/bin/php
> <?php
>
> // Your code here
>
> ?>
>
....this will only work if you happen to have the CLI PHP in /usr/bin/php and
have permissions to run it. If not, but assuming you have shell access, you
could try accessing a URL using wget or curl.
If you don't have access to cron (or at) you could still write a daemon
process that wakes up at intervals to do its stuff - see sleep().
HTH
C.
[Back to original message]
|