Welcome Guest, Not a member yet? Register   Sign In
help .... I got a FATAL ERROR -- probably syntax
#33

[eluser]JPrieto[/eluser]
[quote author="SpooF" date="1243592927"]I've duplicated the tutorials many of times try to answer new users questions. I currently have a duplication on my development server right now.[/quote]

hi SpooF

right now i got to the point where you can insert a coment for a blog entry

when i type in a comment i get this error:

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

and the url in the browser is

http://localhost/codeigniter/index.php/b...nts_insert

==========================================
here is my code in the blog controller
========================================
Code:
<?php
Class Blog extends Controller
{
    Function Blog()
    {
        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('blog_view',$data);
    }
    Function comments()
    {
       $data['title']= "My Comment Title";
       $data['heading']= "My Comment Heading";
       $this->load->view('comment_view',$data);
    }
    Function comment_insert()
    {
       $this->db->insert('comments',$_POST);
       redirect('blog/comments/'.$_POST['entry_id']);
      
    }
}
?>

================================
my code for the comments_view file
===================================
Code:
<html>
<head>
  <title><?php echo $title; ?></title>
</head>
<body>

<h1> &lt;?php echo $heading; ?&gt; </h1>


&lt;?php if($query->num_rows() >0 ): ?&gt;

      &lt;?php foreach($query->result() as $row ): ?&gt;
            <h3>&lt;?php echo $row->body; ?&gt;</h3>
            <p>&lt;?php echo $row->author; ?&gt;</p>
            <hr>
      &lt;?php endforeach; ?&gt;
      
      
&lt;?php endif; ?&gt;


<p>&lt;?php echo anchor('blog','Back to Blogs'); ?&gt;</p>



&lt;?php echo form_open('blog/comment_insert/'); ?&gt;
&lt;?php form_hidden('entry_id',$this->uri->segment(3)); ?&gt;
<p>&lt;textarea name="body" rows="10"&gt;&lt;/textarea></p>
<p>&lt;input type="text" name="author"&gt;&lt;/p>
<p>&lt;input type="submit" value="Submit Comment"&gt;&lt;/p>
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

i also tried to comment out the code in the comment_insert function
and replaced it with a simple echo 'hello there' -- but i still get same error

please ... any idea?


Messages In This Thread
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 06:55 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 06:58 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:01 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:03 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:11 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:14 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:16 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:23 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:39 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:40 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:47 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 07:52 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 08:00 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 08:08 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 08:26 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 09:07 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 09:11 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 09:15 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 09:21 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 09:25 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 09:31 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 09:34 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 09:38 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 09:50 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 10:04 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 10:13 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 10:21 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 10:30 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 10:41 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 10:43 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 11:04 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-28-2009, 11:28 PM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-29-2009, 12:25 AM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-29-2009, 12:29 AM
help .... I got a FATAL ERROR -- probably syntax - by El Forum - 05-29-2009, 01:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB