Page 1 of 1

Long Script, emailed when done?

Posted: Thu Jun 16, 2005 10:21 am
by Todd_Z
I have a script that is very time consuming, what I want to do is when the user submits the information, a php script is run which then sends results to the inputted email address. I want the php script to run just on the server though, with no interaction with the user, meaning they don't have to stare at a progress bar for 20 minutes while the script runs. Any clues on how to do this?

Posted: Thu Jun 16, 2005 11:26 am
by Buddha443556
There are plenty of ideas in Program Execution Functions.

Probably need these:

Code: Select all

set_time_limit(0); // 0 = unlimited time
ignore_user_abort(true);
Have you considered using a cron to run the process? With a cron you could limit the number of processes running to suit your resources and schedule processing for off-peak times. Maybe a bit more complicated to code though.

Posted: Thu Jun 16, 2005 3:48 pm
by Todd_Z
Well using cron jobs, it would run at every x interval, but I would just like for it to run immediately when the user submits the info, and then allow the user to navigate around the site while the script runs, im gonna try the ignore abort idea - thanks!