Hi! there.i'm trying to write a function that runs after a regular periode.For example the function should pull data like new suscribed clients from my database every 6 PM.the fact is i don't have idea about how to implement it.can anyone give me an idea?
I'm on windows and running XAMPP 1.6.5 thanks
Implementing scheduled task:HOW TO?
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Implementing scheduled task:HOW TO?
It sounds like a cron job would be the most fitting solution for this.
Take a look at http://www.sitepoint.com/article/introducing-cron
Do you use cPanel? If so, cron jobs are very simple to setup from here.
Hope this helps
Take a look at http://www.sitepoint.com/article/introducing-cron
Do you use cPanel? If so, cron jobs are very simple to setup from here.
Hope this helps
Re: Implementing scheduled task:HOW TO?
Ok! have the understanding.One more question.Since the cron job is done by Linux OS ,that means i can't try it with my XAMPP package locally.Most of the time we develop on windows and deploy on linux isn't there anything else to test and see its behaviour in terms of testing?thanks
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Implementing scheduled task:HOW TO?
I'm not entirely sure about local testing - sorry 
Re: Implementing scheduled task:HOW TO?
hello! i'm thinking about a new scenario where the task is limited a number of time.for example i'm sending a sms from the web sites and the actual sending is done through a http request.I'll need to check if the sms is delivered to the handset by another http request which i'm sending with the curl library let's say every 5 seconde and 5 times only.am i still in the case of linux cron job? can this be done in php ?and is there a better option to achieve this?please let me know.thanks
Re: Implementing scheduled task:HOW TO?
I use a windows server and have a load of "cron jobs"/scheduled tasks running... what i do is use the built in "sceduled taks" thing in windows.
Just make a new task to run:
Where "C:\PHP5\php.exe" is the location of your php.exe file and "D:\files\do.php" is the file you want to run!
Hope that helps...
Just make a new task to run:
Code: Select all
C:\PHP5\php.exe -f D:\files\do.phpHope that helps...
Re: Implementing scheduled task:HOW TO?
thanks dude!i'll try that