tobeyt23 Posted April 24, 2009 Share Posted April 24, 2009 I have a for loop that executes a ajax call each time thru. How do I after they have all completed then do something else like a redirect? Quote Link to comment Share on other sites More sharing options...
jackpf Posted April 24, 2009 Share Posted April 24, 2009 header('Location: page.php'); Or window.location = 'page.php'; Quote Link to comment Share on other sites More sharing options...
ricmetal Posted April 26, 2009 Share Posted April 26, 2009 or refresh meta tag (google it) the header doesnt always work...........and the onload is javascript these are your options, pick 1 i pick number 3 but sir, yoo haven't read your options yet i dont care, im the president, i supposed to lead..not read.. Quote Link to comment Share on other sites More sharing options...
jackpf Posted April 26, 2009 Share Posted April 26, 2009 header() is the proper way of doing it in my opinion. What do mean by "it doesn't always work"? I've never found a header() to "not work"... Quote Link to comment Share on other sites More sharing options...
ricmetal Posted April 26, 2009 Share Posted April 26, 2009 for some reason it stopped redirecting my pages yesterday, when it did so for weeks. i searched the net and it says something like if you write any code (or text, im not sure) before the header redirect, it wont work. Quote Link to comment Share on other sites More sharing options...
jackpf Posted April 26, 2009 Share Posted April 26, 2009 Yeah, if you send html to the page before you send your headers (without using output buffering) they won't send. If you have errors turned on, you'll get one. It's the same with cookies or sessions or any other headers. But that's logical - you can't send content before a header. Quote Link to comment 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.