Skip to main content
gamedev.net
🔒 Locked

[web] Auto Trigger PHP File

Started by pakloong82 Sep 13, 2006 at 1:13 PM 2 replies 950+ views
Original Post
pakloong82
pakloong82
Hi there, I wonder can a php file automatically trigger itself without being called. For example, I reside a php file that do auto backup of the databse in a protected folder and only admin can access it. Now I want that file to automatically trigger itself without the admin calling using browser at a particular time, so is this possible? Thank you in advance.
:)
Cygnus_X
Cygnus_X
If you can run cron jobs on your machine, then yes.... you can set up a php file that will get run at certain intervals of the day.
Rob Loach
Rob Loach
If you can't get cron working, you can also store a variable saying when the next "update" should happen. Whenever the page is accessed, it checks whether that update time has passed and you do whatever it is you want to do periodically.
Rob Loach [Website] [Projects] [
ToohrVyk
ToohrVyk
Quote:
Original post by Rob Loach
If you can't get cron working, you can also store a variable saying when the next "update" should happen. Whenever the page is accessed, it checks whether that update time has passed and you do whatever it is you want to do periodically.


Unless the page is never accessed.

The best solution in my opinion is to use a crontab, as mentioned earlier.

If you cannot set up crontabs on your server, well, use wget or similar tools to send an HTTP request for the script to be executed, and run the crontab on your own computer or any other computer you have access to.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.