Welcome Guest, Not a member yet? Register   Sign In
Parse Error!
#1

[eluser]Peejk[/eluser]
Hello, I just started using CodeIgniter yesterday and I have watched the tutorials and I'm pretty sure I've got the coding right but I get a parse error when I upload..

Here's the error;
Parse error: syntax error, unexpected $end in /home/hmdwebde/public_html/blog/system/application/controllers/blog.php on line 39

Any help?

I've looked at my blog.php but it looks fine, heres my blog.php;
Code:
<?php

class Blog extends Controller {
    
    function Blog()
    {
        parent::Controlloer();
        
        $this->load->helper('url');
        $this->load->helper('form');
        
        $this->load->scaffolding('entries');
    }
    function index()
    {
        $data['title'] = "My Blog Title";
        $data['heading'] = "My Blog Heading";
        $data['query'] = $this->db->get('entries');
        
        $this->load->view('blog_view', $data);
    }

     function comments()
     {
        $data['title'] = "My Comment Title";
        $data['heading'] = "My Comment Heading";
        $this->db->where('entry_id', $this->uri->segment(3));
        $data['query'] = $this->db->get('comment');
        
        $this->load->view('comment_view', $data);  
     }
    
     function comment_insert()
     {
         $this->db->insert('comments', $_POST);
        
         redirect('blog/comments/'.$_POST['entry_id']);
}

?>

Are there any other files you need to see?

Thanks In Advance,
Hugo
#2

[eluser]jedd[/eluser]
Hi Hugo and welcome to the CI forums.

[quote author="Peejk" date="1258692032"]
Code:
class Blog extends Controller {
[/quote]

This { doesn't have a matching closing }

Also, don't bother with the closing ?> tags - they can cause all kinds of weird problems.
#3

[eluser]Peejk[/eluser]
Now I get this error;
Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/hmdwebde/public_html/blog/system/application/controllers/blog.php:41)

Filename: codeigniter/Common.php

Line Number: 356

404 Page Not Found
The page you requested was not found.

So what should I do, I can just go over the tutorial again I suppose.
I'm a newbie, I have absolutely no idea what I'm doing :down:
#4

[eluser]Peejk[/eluser]
Bump?
#5

[eluser]jedd[/eluser]
Hi Peejk - post code, whenever you make changes.

[quote author="Peejk" date="1258707985"]
[code]
Message: Cannot modify header information - headers already sent by (output started at /home/hmdwebde/public_html/blog/system/application/controllers/blog.php:41)
[/quote]

You either have a space before the <? or you still have the ?> tag in place. If it turns out you have the ?> tag still in play - after I pointed out you should get rid of it as it causes weird problems - you'll probably feel like a right goose.

(Okay, you might possibly have a different problem, but those two cause 99% of these errors.)




Theme © iAndrew 2016 - Forum software by © MyBB