Lithium Posted February 10, 2009 Share Posted February 10, 2009 This is a shout for help, as i got stucked and can't seem to get this going... header('Location:'.$_SERVER['SERVER_NAME'].'/validate.php?page='.$page.''); - This one errors with "Warning: Cannot modify header information" message. This one works, yet it briefly messes the layout and is slow <META HTTP-EQUIV="refresh" CONTENT="0;URL=validate.php?page=<?=$page?>"> document.location.href - this one is not an option. Also already tried to clean out buffers before redirecting but outcome is the same. Any ideas? Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted February 10, 2009 Share Posted February 10, 2009 Re: header() alternative Add to top of page: ob_clean(); Then as for your header code: $page = $_SERVER['PHP_SELF']; @header('Location: '.$_SERVER['SERVER_NAME'].'/validate.php?page='.$page); exit; Quote Link to comment Share on other sites More sharing options...
Lithium Posted February 10, 2009 Author Share Posted February 10, 2009 Re: header() alternative killah: i've thought of that option, Also already tried to clean out buffers before redirecting but outcome is the same. and oddly enough it keeps erroring! Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted February 10, 2009 Share Posted February 10, 2009 Re: header() alternative Did you use the above code i gave? Try adding: error_reporting(E_ALL); ini_set('error_reporting', 1); Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted February 10, 2009 Share Posted February 10, 2009 Re: header() alternative Tried adding ob_start(); after the <?php usually works for me. Quote Link to comment Share on other sites More sharing options...
Lithium Posted February 10, 2009 Author Share Posted February 10, 2009 Re: header() alternative Tried adding ob_start(); after the <?php usually works for me. Yet oddly enough... this one worked! @ killah the code you have given was one of many tries before my OP. Thx both :) Quote Link to comment Share on other sites More sharing options...
oxidati0n Posted March 24, 2009 Share Posted March 24, 2009 Re: header() alternative That header message usually appears when you have whitespace or content displaying before the header. The header is announced before the HTML, so the browser can render it. How can it render with HTML to process? It screws it up. Hope it helps. 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.