tetuanrp Posted May 11, 2007 Share Posted May 11, 2007 Okay, so I stripped down everything I could. This problem only arises in i.e. I have a form, with an action set to login.php. In that login.php, I was checking the DB for the user, and using header to redirect. I was noticing in i.e. sometimes it'd follow the header, sometimes not. So now I stripped out my login.php to be just a header: header("Location: mgm/base.php"); If I keep submitting the form, sometimes it will follow the header, sometimes not. Why would that be? Only a one line script which is driving me nuts. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/ Share on other sites More sharing options...
corbin Posted May 11, 2007 Share Posted May 11, 2007 Try making it a full path? I don't remember very well, but I think it needs to be a full path. Also, even with just that as the content, it only follows it sometimes? Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250905 Share on other sites More sharing options...
kalivos Posted May 11, 2007 Share Posted May 11, 2007 It can be a relative path... BUT this is IE we are talking about.... Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250909 Share on other sites More sharing options...
MadTechie Posted May 11, 2007 Share Posted May 11, 2007 some code would help!! have you got a sample we can try? Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250914 Share on other sites More sharing options...
tetuanrp Posted May 11, 2007 Author Share Posted May 11, 2007 Tried a full url, and no luck. It's really strange, I'll click the submit button, it'll follow the header to the correct page. I'll then hit back, and hit submit again, and it'll just go to a blank page (the url bar won't change either). I put an echo in just to make sure it's hitting the php script everytime, and that works correctly every time I submit, it's just the header function acting goofy. Only on ie. Seems like a very basic issue. Form page: http://clients.palisadesinteractive.com/mgm/ u: mgm p: m1g2m3 Login.php script: <?php session_start(); $_SESSION['authenticated'] = 'mgm'; header("Location: http://clients.palisadesinteractive.com/mgm/base.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250916 Share on other sites More sharing options...
john010117 Posted May 11, 2007 Share Posted May 11, 2007 I've never had that problem happen with Firefox. What version of IE are you using? Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250918 Share on other sites More sharing options...
MadTechie Posted May 11, 2007 Share Posted May 11, 2007 works in FF 2 & IE7 for me! edit: by works i mean i got the exact same results Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250920 Share on other sites More sharing options...
tetuanrp Posted May 11, 2007 Author Share Posted May 11, 2007 Windows/ie 6.0 Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250922 Share on other sites More sharing options...
MadTechie Posted May 11, 2007 Share Posted May 11, 2007 you sure its not a cacheing issule! Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250926 Share on other sites More sharing options...
tetuanrp Posted May 11, 2007 Author Share Posted May 11, 2007 Yep, just cleared cache, rebooted even, and tried. Can someone on ie6 or lower try going and hitting submit (after the correct info is entered). Then hit back, and simply hit submit again? When I do it, it comes to a blank screen. IF I do get to that blank screen, and hit refresh, the correct pages that it should have originally redirected to shows. Really strange. Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250927 Share on other sites More sharing options...
tetuanrp Posted May 11, 2007 Author Share Posted May 11, 2007 ALright, I've come to a conclusion that the header function does not work correctly in ie when it's the action of a form. Any one have any other methods for page redirection? Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250947 Share on other sites More sharing options...
tetuanrp Posted May 11, 2007 Author Share Posted May 11, 2007 Actually, removed the Session checker on the page I'm redirecting too, and that did it for some reason. Guess I'll have to figure out another way to verify sessions. Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250949 Share on other sites More sharing options...
MadTechie Posted May 11, 2007 Share Posted May 11, 2007 try Javascript as for the session_start() try @session_start(); Quote Link to comment https://forums.phpfreaks.com/topic/50994-solved-header-not-working-from-form/#findComment-250951 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.