raduenea Posted March 21, 2016 Share Posted March 21, 2016 I the following syntax in a page: [php code1] header('Location: https://www.google.com'); [php code2] What I whould like to do is to redirect to google.com and in the background to execute the code from .In this moment the code from above open google.com but don't start to load it until [php code2] executed completely.I need actualy google.com to start loading the page and in the background to execute the code from [php code2]. Thanks in advanced. Quote Link to comment https://forums.phpfreaks.com/topic/301057-redirect-in-php/ Share on other sites More sharing options...
iarp Posted March 21, 2016 Share Posted March 21, 2016 What exactly are you trying to accomplish that requires processing after the redirection? As long as no other headers or data has been sent yet that header will kill your script instantly and send the user on their way. Quote Link to comment https://forums.phpfreaks.com/topic/301057-redirect-in-php/#findComment-1532275 Share on other sites More sharing options...
ginerjm Posted March 21, 2016 Share Posted March 21, 2016 Any header call s/b followed by an exit() command. When one has the need to use the header location command he is saying he's done with the current script. Quote Link to comment https://forums.phpfreaks.com/topic/301057-redirect-in-php/#findComment-1532283 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.