If visitor clicks stop button of browser then php script at server stop executing or it will execute till completion ?
Printable View
If visitor clicks stop button of browser then php script at server stop executing or it will execute till completion ?
I suppose it depends, PHP is a powerful language for web development, I have been developing with it for over 1.5 years and pretty much have everything memorized, but I have not seen a script that cannot be stopped by the stop button.
However, you can output a value if the script is stopped, if that helps at all:
http://us2.php.net/manual/en/function.exit.php
If the Stop button is pressed then yes, it will stop at whatever point it was executing at. For example, if you have a script which has a for() loop printing out 20,000 numbers, and a user presses Stop when it's at 10,000, the browser will stop asking for the script from the server and so the server will stop executing/sending it to the client. The numbers displayed will therefore be 1 through 10,000.
Actually, there is a function that you can call that prevents PHP from cancelling your script even if the user presses the stop button. But I forgot its name.