I have a script that starts with: ignore_user_abort(true)
It sends emails out. The reason I use ignore_user_abort(true) is because I am hitting the page using AJAX, and it is possible that the user may close the browser window before the script is done & I want it to continue anyways.
I am wondering if I add exit() to the end of the script will that be enough to end the script from running or do I have to use flush() or out put some type of text?
Also, am I correct in my asusmption that if I hit a PHP page using AJAX (via jQuery), and add the ignore_user_abort(true) to the start of the script it will act the same as if the user were to access the page directly?
Of course it will.
ignore_user_abort()only affects whether the script stops if the browser terminates the page load; it has no effect on anything else.