Chat Posted March 17, 2008 Share Posted March 17, 2008 hi, i have a problem - my sites do some complicated stuff like resizing and copying files... and the browser always crashes when running such heavy-task scripts. but the server always gets the job done - it just takes a minute or two... so i want to be able to communicate with my website users and say that it's half done / all done...etc so is there any way i can set a timer within php to check if all relevant files have been made, after 20 seconds of starting the script... and then can i report back to the website user this information? dan Quote Link to comment Share on other sites More sharing options...
craygo Posted March 17, 2008 Share Posted March 17, 2008 Since PHP is a server side script you won't be able to have any kind of progress bar. If it takes a while you could up the timeout setting in the php.ini file so the script will run in it's entirety. And just echo a simple message saying the script is running please wait, and at the end use a META tag to redirect the person to a page which states the script has completed. You would not be able to use a header for the redirect because you would be sending information to the browser saying the script is running so you would get an error. Ray Quote Link to comment Share on other sites More sharing options...
Chat Posted March 17, 2008 Author Share Posted March 17, 2008 thanks for the tip ray the problem is not that my script doesn't complete itself - it does all the necessary work, but the browser seems to stop listening and waiting for the script to echo it's last bits. althought the browser also doesn't stop "loading" so presumably it's still listening. the script still finishes all jobs tho.... it's only the final echoing back to the browser that doesn't work. the copying of files and stuff before and after all echos work fine. any further advice please... will be much appreciated Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.