Is there a way to make PHP do something on a certain date?
Like without a user going to the page and causing PHP to check the date?
Or does this require me to setup a cron type thing per-server?
Is there a way to make PHP do something on a certain date?
Like without a user going to the page and causing PHP to check the date?
Or does this require me to setup a cron type thing per-server?
cron is by far the simplest and most reliable way to do so, since it’s a function of the system rather than an external script that might be interrupted…
Is there a particular reason you’re trying to avoid cron?
cron would definitely be the way to go. If you have cPanel this is VERY easy to do. There are many tutorials online regarding setting up a cron job.
Hey, Because it’s for distributed software I don’t want users to have to monkey with this as it might be fairly confusing.
There is no mechanism by which PHP is capable of delaying or setting itself to run at a certain date.
PHP only runs when it’s told to run.
If you have a high traffic page you can tell PHP to do something on a certain date, but you have to record that it happened somehow otherwise it will carry out that action ALL DAY LONG.
Here are 2 old threads mentioning “poor mans cron”.
To reiterate: These are not the best solutions, but might work for you.