phpknight Posted August 13, 2007 Share Posted August 13, 2007 I have a series of redirect tests so only a logged in user can see certain pages. I was getting a few odd behaviors from the script. Then I tested it using something like this: header("Location: blah"); mail("[email protected]", "you shouldn't be here", "eom"); I assumed that once the redirect occurs the PHP page stops executing immediately in mid-script. Is this false? Should I really be receiving this email? If so, when does the execution of the script actually stop? The redirects are happening correctly, but I would assume I would never get this email at all. Link to comment https://forums.phpfreaks.com/topic/64609-solved-is-this-header-behavior-normal/ Share on other sites More sharing options...
gurroa Posted August 13, 2007 Share Posted August 13, 2007 PHP page stops executing only at the end of the script, on the errors occure or you can stop the process by calling die() or exit() command. Link to comment https://forums.phpfreaks.com/topic/64609-solved-is-this-header-behavior-normal/#findComment-322134 Share on other sites More sharing options...
phpknight Posted August 13, 2007 Author Share Posted August 13, 2007 So, you are saying that I should go like this: //redirect exit; Is that what you mean? Link to comment https://forums.phpfreaks.com/topic/64609-solved-is-this-header-behavior-normal/#findComment-322141 Share on other sites More sharing options...
phpknight Posted August 13, 2007 Author Share Posted August 13, 2007 Yes, that is what you meant. Thanks! Link to comment https://forums.phpfreaks.com/topic/64609-solved-is-this-header-behavior-normal/#findComment-322146 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.