[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><?php echo $heading?></h1>
<?php foreach($query->result() as $row): ?>
<h3><?=$row->title?></h3>
<p><?=$row->body?></p>
<p><?=anchor('blog2/comments/'.$row->id, 'Comments');?></p>
<hr>
<?php endforeach; ?>
</body>
</html>