Forum Moderators: coopster
Obviously this takes a while and as soon as there are more than a few images this script will run for 30 seconds +
What i would like to do is let the script run for as long as it takes without melting the server, whilst keeping a report on how long to go, out to the browser.
What i normally do is let a script like this do a few operations, then let it end, outputting a meta-refresh to the browser, then continuing where it left off once the page reloads.
Is it possible to do it another way?
As far as a progress meter - you could just count the number of images in the directory, then after each one, output something like "processed m of n images" to the browser.
For long scripts, you also need to use set_time_limit(0);
use of the set_time_limit(0) and the sleep command seems to work nicely.
what wasn't happening was the ouputting to browser, it's a bit hit n miss on my local Win32 Apache but seems fine on my server using flush(), end_flush() so long as i send a decent amount of html to the browser first (php suggest I.E. likes at least 256 bytes before any output gets sent).
thanks again
hughie