Necuima 18 Posted March 16, 2018 Report Share Posted March 16, 2018 Hi Larry, Can you please give me your thoughts on two window relocation techniques that I use as to which one, if any, is better. $url and header (in PHP) or JS window.location.replace(url) with the urls set appropriately. window.location.replace seems to be better if you are using sessions to avoid the 'headers already sent' issue but I'd appreciate your advice. Best wishes from Oz Quote Link to post Share on other sites
Larry 428 Posted March 19, 2018 Report Share Posted March 19, 2018 Personally, I would always do it in PHP if you can. In other words, if the need for redirection is identified in the PHP code, then the redirection should happen there. Conversely, if the user has visited a page already and you want to redirect them without them loading another page, you'd use JavaScript. This should be fairly uncommon. Quote Link to post Share on other sites
Necuima 18 Posted March 20, 2018 Author Report Share Posted March 20, 2018 Thanks, Larry, I always appreciate your advice. Cheers Quote Link to post Share on other sites
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.
Note: Your post will require moderator approval before it will be visible.