Jump to content

Headers problem, but where are the whitespace?


JJohnsenDK

Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.