Wordpress PHP Include

EDIT SOLVED The code <?php ob_start(); ?> put before any other output seemed to solve the problem.

I have a problem with errors appearing on a page on my site.

I am including 3 php files before any HTML output which is.

<?php
include_once("rpw_includes/dtd_site_root.php");
include_once("rpw_includes/dtd_remote_module_classes.php");
include_once("rpw_includes/rpw_remote_module_classes.php");
?>
<!DOCTYPE html>
<head>

That code is in my header.php file and all works fine on my index file but when i go onto another page which also calls the same header file i get these errors.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\barnet\wp-content\themes\barnet\search-results.php:7) in C:\xampp\htdocs\barnet\wp-content\themes\barnet\rpw_includes\dtd_remote_module_classes.php on line 15

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\barnet\wp-content\themes\barnet\search-results.php:7) in C:\xampp\htdocs\barnet\wp-content\themes\barnet\rpw_includes\dtd_remote_module_classes.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\barnet\wp-content\themes\barnet\search-results.php:7) in C:\xampp\htdocs\barnet\wp-content\themes\barnet\rpw_includes\dtd_remote_module_classes.php on line 17

Any ideas?

EDIT*

search-results.php

<?php 
/*
Template Name: Search Results
*/
?>
<?php ob_start(); ?>
<?php get_header(); ?>

<div id="page-search-hold">
<Div id="page-search"></div>
</div>

<?php 
$module_obj= new RPW_results_obj();
$module_obj->write_html(); 
?> 

<?php get_footer(); ?>

With the ob_start(); added the errors dissapear but i get about a 20px margin before my body starts like there should be erros but they are just not showing?

Answers


Make sure that the other page that includes header.php has the include as the very first line.


Need Your Help

Facebook bookmarks using JavaScript

javascript facebook facebook-javascript-sdk

I need to open the "Facebook Bookmark" popup when an user click a button. Using FBML, I found this code:

How do I get a VBA function to use the current query as an argument in Access?

vba ms-access excel-vba

I have a function that I use to open a query into a new and unnamed Excel spreadsheet from a form control, using the onclick event of the control to hardcode the query as the argument of the functi...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.