leel Posted August 12, 2007 Share Posted August 12, 2007 I'm recieving a "Warning: Cannot modify header information - headers already sent by" error on this script I'm using. The only thing I'm trying to do is center the html and this file seems to be the only way to center it. Using <center> in the header file doesn't work. But if I add .. echo "<center />\n"; to this shared php file that's called on every page, it centers everything but I also get the error above. Am I just using the wrong syntax? I hope I'm being clear enough, if not I'll post more info. TIA! Quote Link to comment https://forums.phpfreaks.com/topic/64463-header-problem/ Share on other sites More sharing options...
phpknight Posted August 12, 2007 Share Posted August 12, 2007 You cannot send headers after printing anything--printing anything automatically sends headers. So, just save that as a variable in your shared php page and print it on the page itself before you send the header. Quote Link to comment https://forums.phpfreaks.com/topic/64463-header-problem/#findComment-321384 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.