Page 1 of 1

how to run script automaticlly in spacific date ?

Posted: Tue Sep 08, 2009 7:27 am
by amira_fcis
hi all,...
i have a problem here which is: i want to send a notification to the user before 2 days to a specified date he entered in db (i.e i want to run a script in a specific date like cron in unix but here iam on windows OS )

Re: how to run script automaticlly in spacific date ?

Posted: Tue Sep 08, 2009 7:43 am
by Mark Baker
Windows has its own equivalent of cron.
It's called "Scheduled Tasks" and con be found on Settings/Control Panel/Scheduled Tasks

Re: how to run script automaticlly in spacific date ?

Posted: Tue Sep 08, 2009 7:44 am
by amira_fcis
but i need to coded it by php..?..look i want to send a notification to the user before his reservation date by 2 days ...so it is dynamic where i get the date of reservation and subtract 2 days then want to run this script to send the notification...? hope u get me .

thanks in advance

Re: how to run script automaticlly in spacific date ?

Posted: Tue Sep 08, 2009 8:58 am
by onion2k
It can't be done in PHP on it's own. PHP only runs when something calls it. Set up Windows Task Scheduler to call a PHP script at a specific time (eg 2AM), then have that script check to see if there are any reservations to send and, if there are, send them.

Re: how to run script automaticlly in spacific date ?

Posted: Wed Sep 09, 2009 4:29 am
by amira_fcis
thanks onion2k ,
ur idea works great wiz me ....thanks alot