Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduling tasks

Status
Not open for further replies.

sanjdhiman

Programmer
Jan 15, 2003
189
GB
Dear all thanks for all ur help so far i have a question to ask..

What i need to do is send out an email to my list of users that match a certain requirement daily. That measn that if on my mailin list which is stored in mySQL matches the criteria then an email is sent out to those individuals but i need this to happen automatically everyday at lets say 12am

So basically what it is doing is matching user profiles with new data entering the database then sending an email to those users that match this requirement.

I heard that task scheduler on Windows is best to use for this as i can make it into a batch file but i have nno idea as to how i iwll achieve this as in what needs to be put in the batch file does anyone know where i can get this info and or any examples out there that are running php mySql AND APACHE to do this type of work

thanks in advance to all of you

sanj
 
I've encountered a similar task in UNIX. I am sure that you can do it with the windows task manager also.
The trick is to have a browser or HTTP agent request the specific PHP file to trigger execution. The PHP code has a log file so it can't be triggered more than once per date.
We used LYNX as a trigger.
I'd schedule a browser that's default homepage is set to to open at the desired time and close the task after 1 minute.
 
If you're in windows (and I'm sure this is easy for linux too, I just haven't done it before)... you can just use the php command line...

so say your script is email.php

just run

php email.php

(by default the php command line is in your php installation directory, i.e. c:\php\php.exe... and is NOT in the path)

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top