470,815 Members | 1,364 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

how can I offload code processing to the server like a "stored procedures "

I have a script that loops through email addresses takes long enough to time
out the web page.

Any ideas how to offload that process or avoid the timeout? Thanks.
Jul 17 '05 #1
5 2061
To stop PHP from timing out, call set_time_limit(0). To keep the browser
from timing out, you need to send something to it every now and then.

At the end of the loop, do something like echo "<!-- NO TIMEOUT -->\n"; Or
if you wish to be more user-friendly--echo "<script>
ShowProgress($processed, $total); </script>\n"; where ShowProgress is a
Javascript function that update something (like a progress bar) on the page.

Uzytkownik "NotGiven" <no****@nonegiven.net> napisal w wiadomosci
news:9z*****************@bignews6.bellsouth.net...
I have a script that loops through email addresses takes long enough to time out the web page.

Any ideas how to offload that process or avoid the timeout? Thanks.

Jul 17 '05 #2
calling set_time_limit(0) is a nice, however it won't override the
maximum execution time stipulated in php.ini. You may wanna have your
script executed from shell with the right parameters(consult the
manual concerning the command line parameters) and redirect the output
to /dev/null or some other place (it depends whether you need the
output or not).

Best Regards,

Lucas
"Chung Leong" <ch***********@hotmail.com> wrote in message news:<pK********************@comcast.com>...
To stop PHP from timing out, call set_time_limit(0). To keep the browser
from timing out, you need to send something to it every now and then.

At the end of the loop, do something like echo "<!-- NO TIMEOUT -->\n"; Or
if you wish to be more user-friendly--echo "<script>
ShowProgress($processed, $total); </script>\n"; where ShowProgress is a
Javascript function that update something (like a progress bar) on the page.

Uzytkownik "NotGiven" <no****@nonegiven.net> napisal w wiadomosci
news:9z*****************@bignews6.bellsouth.net...
I have a script that loops through email addresses takes long enough to

time
out the web page.

Any ideas how to offload that process or avoid the timeout? Thanks.

Jul 17 '05 #3
alternatively, you may fork off the daemon process with a signal
handler making it "independent" of any events on the client side. See
some tutorials on process control functions for further details on
this matter.
Best Regards,

Lucas
"Chung Leong" <ch***********@hotmail.com> wrote in message news:<pK********************@comcast.com>...
To stop PHP from timing out, call set_time_limit(0). To keep the browser
from timing out, you need to send something to it every now and then.

At the end of the loop, do something like echo "<!-- NO TIMEOUT -->\n"; Or
if you wish to be more user-friendly--echo "<script>
ShowProgress($processed, $total); </script>\n"; where ShowProgress is a
Javascript function that update something (like a progress bar) on the page.

Uzytkownik "NotGiven" <no****@nonegiven.net> napisal w wiadomosci
news:9z*****************@bignews6.bellsouth.net...
I have a script that loops through email addresses takes long enough to

time
out the web page.

Any ideas how to offload that process or avoid the timeout? Thanks.

Jul 17 '05 #4
thanks
"NotGiven" <no****@nonegiven.net> wrote in message
news:9z*****************@bignews6.bellsouth.net...
I have a script that loops through email addresses takes long enough to time out the web page.

Any ideas how to offload that process or avoid the timeout? Thanks.

Jul 17 '05 #5
According to Lucas <th******@directbox.com>:
calling set_time_limit(0) is a nice, however it won't override the
maximum execution time stipulated in php.ini.


Actually, this is only the case if PHP is in safe mode. If not in safe mode,
the script is allowed to set the maximum execution time to whatever it wants.

--
eth'nT
http://www.hydrous.net
to email: remove all capital letters from given address
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Steve Holden | last post: by
2 posts views Thread by honcho | last post: by
4 posts views Thread by Bharani Dharan | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.