How can I stop the execution of a script? Simply pushing the browser's stop button? or how else?
stopping the execution of a script
call an exit() or die() function in your code
<?
echo "Hello";
die(); // or exit();
echo "World";
?>
this is what would be shown
Hello
hth
I expressed myself wrongly. What I mean was how to stop a running script?
as in while in a web browser?
if not, during a function or a cause, can use: break;
hope i helped. (:
Yes while browsing. I push the stop button but the script seems to be executed on the server still. Is it enough to push stop button to stop the script execution?Or how to stop?
sorry dude, that i dunno. haha, think u'll kill me. (:
if i'm not mistaken, pushing the stop button just as it to stop d/l or u/l stuff.
hope others can help u. (:
Originally posted by siyisoy
Yes while browsing. I push the stop button but the script seems to be executed on the server still. Is it enough to push stop button to stop the script execution?Or how to stop?
consider the following tidbit in php:
ignore_user_abort(1); //Tells the script to keep running, even if client terminates or something
It is very usefull to have if for instance you are doing an update and checking stuff that will result in a flawed data structure if not completed, thus ignore_user_abort and let the script finish so no bad shit happens :-)