Allan- Posted November 29, 2008 Share Posted November 29, 2008 If i have header('Location: http://localhost/'); on line 1-222 in my index.php file then it works correctly as it should be but if the same line of code is in the line 223 or after that, then header() function just dont do anything. I run my codes on my localhost server (Wampserver 2). Quote Link to comment Share on other sites More sharing options...
ShiloVir Posted November 29, 2008 Share Posted November 29, 2008 http://www.phpfreaks.com/forums/index.php/topic,37442.0.html Theres a big stickie on this subject. Basicall header(); Must come before anything else. Quote Link to comment Share on other sites More sharing options...
Allan- Posted November 29, 2008 Author Share Posted November 29, 2008 But what should I use instead of header() function when I have to use it in the middle of the other code? Quote Link to comment Share on other sites More sharing options...
revraz Posted November 29, 2008 Share Posted November 29, 2008 You should display errors and enable error reporting. That way you can see where your Header error is. You can use javascript or HTML redirects instead. Quote Link to comment Share on other sites More sharing options...
Allan- Posted November 29, 2008 Author Share Posted November 29, 2008 Thanks, I'll use meta refresh now then. 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.