c_shelswell Posted February 15, 2007 Share Posted February 15, 2007 I've got a login script that checks the details entered if no errors occur it does a meta refresh to the main page. It's working fine on my dev box in firefox and ie6 but as soon as i upload it it only works in firefox. IE6 just does a refresh to the same page. Can't understand why it would do that. my code is if ($logged_in == false && $_SESSION['error'] == "" ) { dispalyLogin(); } elseif ($logged_in == true) { echo "<meta http-equiv=\"Refresh\" content=\"0 ;url=./altsource.php\">"; } any ideas? Or alternative ways of doing it. Thanks Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 15, 2007 Share Posted February 15, 2007 use the header(); function. http://au.php.net/header a tad way down the page will be the one your looking for. just read up. Quote Link to comment Share on other sites More sharing options...
c_shelswell Posted February 15, 2007 Author Share Posted February 15, 2007 i tried that but the problem is i get the error message saying the headers are already set not sure how to redo it to avoid that Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 15, 2007 Share Posted February 15, 2007 this is a workaround but at the top of your page put ob_start(); and put ob_end_flush(); at the bottom of your page. Quote Link to comment Share on other sites More sharing options...
c_shelswell Posted February 15, 2007 Author Share Posted February 15, 2007 cheers that works but strangely enough only on my dev box as soon as i upload it ie6 still won't work. I've changed to the header method rather than refresh as well. I can't understand why ie would do that and not firefox. The site is www.alternatesource.co.uk cheers Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 16, 2007 Share Posted February 16, 2007 what exactly happens in IE? The page not changing? or do you get errors? Quote Link to comment Share on other sites More sharing options...
c_shelswell Posted February 16, 2007 Author Share Posted February 16, 2007 no errors just looks likes its refreshed clears the form and remains on the same page. Find it very strange how it works fine on IE on my pc's apache but online it freaks out. Will check it on another pc today and see what it does. Cheers Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted February 16, 2007 Share Posted February 16, 2007 Why not use include("nextpage.php"); ??? Quote Link to comment Share on other sites More sharing options...
The_Assistant Posted February 16, 2007 Share Posted February 16, 2007 can we have a link to check the error? Quote Link to comment Share on other sites More sharing options...
c_shelswell Posted February 16, 2007 Author Share Posted February 16, 2007 Have just tried it on my mates pc whilest the site's online and it seems to be working. the link is http://www.alternatesource.co.uk if it happens to you any feedback would be great cheers Quote Link to comment Share on other sites More sharing options...
The_Assistant Posted February 17, 2007 Share Posted February 17, 2007 can we have full code to cross reference? and a test username and password would be helpful. Quote Link to comment Share on other sites More sharing options...
Archadian Posted February 17, 2007 Share Posted February 17, 2007 Try this: echo "<meta http-equiv=\"refresh\" content=\"1;url=../altsource.php\">"; 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.