JJohnsenDK Posted November 28, 2007 Share Posted November 28, 2007 Hey I have been looking at this code for some time now and i just cant find the whitespace that the error tells me is there some where. Error: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\taarnby\home.php:9) in C:\xampp\htdocs\taarnby\sites\gallery.php on line 7 Code: <?php session_start(); require_once("functions/index.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="keywords" content="<?=$settings['keywords'];?>" /> <meta name="description" content="<?=$settings['description'];?>" /> <title><?=$settings['title']?></title> <link type="text/css" rel="stylesheet" href="<?php echo "".THEME."";?>" /> <script type='text/javascript' src='includes/jscripts/javascript.js'></script> <script language='javascript' type='text/javascript' src='includes/jscripts/tiny_mce/tiny_mce.js'></script> <script language='javascript' type='text/javascript'> tinyMCE.init({ theme : 'advanced', mode : 'textareas', language : 'da' }); </script> </head> <body> <div id='main'> Line 9 is this line: <meta name="keywords" content="<?=$settings['keywords'];?>" /> Anyone who can see the error? Quote Link to comment Share on other sites More sharing options...
Dane Posted November 28, 2007 Share Posted November 28, 2007 You can not output any HTML. Read here. http://www.phpfreaks.com/forums/index.php/topic,37442.0.html Quote Link to comment Share on other sites More sharing options...
schme16 Posted November 28, 2007 Share Posted November 28, 2007 Jeez Dane, be nice. Look, JJohnsenDK he is right, try to omit a bit more next time. But! I did test what you gave, and it gave no errors whatsoever perhaps its in the included files that something is stuffing up eh? Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 28, 2007 Share Posted November 28, 2007 Whitespace isn't the only[/] culprit... it's just the 'hidden' culprit, since you can't see it without a text editor that highlights (or you drag highlighting). Anyways, ANY output at all is considered, well, output. And if something is being sent to the browser, PHP doesn't like to just stop and send something entirely different. This is an absolutely EASY bug to track down once you are familiar with what causes it. In fact, I dare to say that once you thoroughly understand the cause, you stop programming that way and never encounter it again! If the concept is kind of foggy to you, it can quickly become an exercise in frustration and brand new curse words! PhREEEk Quote Link to comment Share on other sites More sharing options...
revraz Posted November 28, 2007 Share Posted November 28, 2007 How was he mean? Jeez Dane, be nice. Quote Link to comment Share on other sites More sharing options...
schme16 Posted November 29, 2007 Share Posted November 29, 2007 Heh, He wasn't mean, just a little more curt than I think a place like PHP Freaks should be... Quote Link to comment Share on other sites More sharing options...
Dane Posted November 29, 2007 Share Posted November 29, 2007 :S. I was just trying to help lol. I told him that you cannot output any HTML and gave him a link to a very good post that helped me with my headers problem. I do apologise if i may have sounded "curt" or whatever <3 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted November 29, 2007 Share Posted November 29, 2007 Let the moderators police the forum, that is what they are here for. If there was anything inappropriate or off topic, a moderator would have dealt with it. Quote Link to comment Share on other sites More sharing options...
revraz Posted November 29, 2007 Share Posted November 29, 2007 If people would take 1 min to read the stickies in the top, we wouldn't have these exact same questions posted over and over. Heh, He wasn't mean, just a little more curt than I think a place like PHP Freaks should be... Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 29, 2007 Share Posted November 29, 2007 Dunno about curt... dry? yep, but a lot of repetitive information can be expected to be delivered dry. He briefly described the cause, directed the OP to read a relevant post, and then moved on with his life. Since the OP has well over 300 posts, I don't think a 'and welcome to PHP Freaks!' would do much for him... haha Anyways, most are here for the information they need to fix a problem. You can blow me a kiss or flip me the bird, I could care less, as long as you help me solve a problem. PhREEEk 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.