sangoku Posted April 1, 2010 Share Posted April 1, 2010 I have a script which runs in background and does some cleanups... I am however in a confusion will a script continue to operate after she sends out a redirection header???? I think it will but i am not certain....... duos someone know it? Quote Link to comment https://forums.phpfreaks.com/topic/197180-after-a-redirect-will-the-script-continue-to-work/ Share on other sites More sharing options...
nafetski Posted April 1, 2010 Share Posted April 1, 2010 Nope, once you redirect it stops Quote Link to comment https://forums.phpfreaks.com/topic/197180-after-a-redirect-will-the-script-continue-to-work/#findComment-1035016 Share on other sites More sharing options...
teamatomic Posted April 1, 2010 Share Posted April 1, 2010 Yes, the script keeps running till it ends or hits a die/exit. You cant however output anything to the page you were on cause with a redirect obviously the buffer is no longer there for output. That is why it is good practice to put an exit after a header redirect, to stop the script from continuing on, unless of course you want something else done after the redirect. HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/197180-after-a-redirect-will-the-script-continue-to-work/#findComment-1035020 Share on other sites More sharing options...
andrewgauger Posted April 1, 2010 Share Posted April 1, 2010 I agree with teamatomic http://php.net/manual/en/function.exit.php Quote Link to comment https://forums.phpfreaks.com/topic/197180-after-a-redirect-will-the-script-continue-to-work/#findComment-1035023 Share on other sites More sharing options...
sangoku Posted April 1, 2010 Author Share Posted April 1, 2010 Okay XD... Quote Link to comment https://forums.phpfreaks.com/topic/197180-after-a-redirect-will-the-script-continue-to-work/#findComment-1035164 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.