View Full Version : Calling php funciton and forgetting about it. how?

07-17-2007, 12:56 PM

I am making a predictor league so people enter predictions of Football matches and they get points depending of the results. When new matches are entered or when the results are tallied and the league tables worked out i have a script to email all the users their points/leagues or to let them know there are more predictions for them.

The email script work great whhen there was 50 users but now there are 1000 it fails most of the time. Either the user closes the screen or it times out.

I was wondcering does anyone know of a way i can get the php code to call another php file to run in the back ground so it will run until its finish and won't matter if the user closes the window.


p.s. i know i can call cron jobs in apache. but work is forcing me to use iis.

Cheers again


07-17-2007, 01:25 PM
Look into using the Windows task scheduler to accomplish what a cron job would do.

07-17-2007, 04:13 PM
Cheers Pal,

I have this

exec("c:\php\php.exe c:\Inetpub\wwwroot\...\emailscript.php");

however it still waits for the script to be finish. Do you know how to change it.


07-17-2007, 04:21 PM
well it will wait for the script to finish no matter what

07-17-2007, 07:11 PM
Also, you could use ignore-user-abort() (http://www.php.net/ignore_user_abort) to keep the script running even when a user closes out a window. But as stated, the cron/windows scheduler is the best route.

07-19-2007, 10:29 AM
Cheers Thank you for the info.

I used a little pop up window that will call the script then close it self after a few second leaving the script running.