Welcome Guest, Not a member yet? Register   Sign In
Message: Cannot modify header information - headers already sent
#1

[eluser]chicadeas[/eluser]
I know I am going to get some ugly replies to this post but I have searched past posts and have had no luck. I have had this problem before with blank spaces before or after php tags but that's not the problem this time. Here is the code in my controller and view files.

Code:
<?php
class Blog2 extends Controller
{

function Blog2 ()
{
parent::Controller();
$this->load->helper('url');
$this->load->helper('form');
}

function index ()
{
$data['title'] = "My blog title";  
$data['heading'] = "My Blog Heading";
$data ['query'] = $this->db->get('entries');

$this->load->view('blog2_view', $data);
}
}


Code:
<html>
<head>
<title><?php echo $title?></title>    
</head>
<body>
<h1>&lt;?php echo $heading?&gt;</h1>    

&lt;?php foreach($query->result() as $row): ?&gt;    
<h3>&lt;?=$row->title?&gt;</h3>
<p>&lt;?=$row->body?&gt;</p>

<p>&lt;?=anchor('blog2/comments/'.$row->id, 'Comments');?&gt;</p>

<hr>
&lt;?php endforeach; ?&gt;
&lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
Message: Cannot modify header information - headers already sent - by El Forum - 05-14-2010, 03:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB