English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

For example: The server is executing a cURL code which needs to contact an outside website. The website takes 1 minute to respond. When the cURL finishes it saves that website into a variable server side. But the user is impatient and clicks the refresh page before the 1 minute is up. After 1 minute will that variable be empty or will it contain the received info?

More Specifically, does the server continue to execute the code until it completes/errors or do user requests like 'refresh' interupt the function's execution?

All of my questions are basically the same. I'm just asking them in such a way that the reader (you) can get as much perspective on the question as possible.

Thank you in advance!

2006-10-22 05:20:21 · 2 answers · asked by Valcar_ 1 in Computers & Internet Programming & Design

2 answers

when a PHP is accessed, each access a new instance of the PHP program is created on the server. the PHP program will complete each time a use refreshes the screen.

If you have a response problem with outside resources, you may want to have a local copy of the resources you are requesting so that the user gets a faster response from your website.

The other easier option is to pop a message on the client side informing the user that the request can take up to x amount of time to complete, please be patient etc etc etc. If the user doesn't get some kind of feedback, they will get impatient and try refreshing or move to another site.

2006-10-22 05:32:59 · answer #1 · answered by Jeffrey F 6 · 0 0

I believe that a REFRESH will force the server to start again. I do not know if the first request finishes in a separate thread or not. It certainly is silly for a user to start BANGING the refresh button... so I would show a screen that says: "please wait".

I've never written a php script that takes that long.

I wrote this SLOW script, so you can see for yourself. But it does not take a minute... Gosh, maybe 3 seconds. (This is a Zip Code lookup).

Yes, you wrote an excellent question. THANKS

Good luck

2006-10-22 12:28:27 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers