how to run script automaticlly in spacific date ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amira_fcis
Forum Newbie
Posts: 16
Joined: Sun Aug 16, 2009 7:59 am

how to run script automaticlly in spacific date ?

Post 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 )
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: how to run script automaticlly in spacific date ?

Post 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
amira_fcis
Forum Newbie
Posts: 16
Joined: Sun Aug 16, 2009 7:59 am

Re: how to run script automaticlly in spacific date ?

Post 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
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: how to run script automaticlly in spacific date ?

Post 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.
amira_fcis
Forum Newbie
Posts: 16
Joined: Sun Aug 16, 2009 7:59 am

Re: how to run script automaticlly in spacific date ?

Post by amira_fcis »

thanks onion2k ,
ur idea works great wiz me ....thanks alot
Post Reply