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

[eluser]JPrieto[/eluser]
got it now

i cleared the browser cache

and it worked

wow -- weird
#32

[eluser]SpooF[/eluser]
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.
#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?
#34

[eluser]SpooF[/eluser]
You have a typo in one of your files. Your fucntion is called comment_insert but your submitting it to comments_insert.
#35

[eluser]JPrieto[/eluser]
[quote author="SpooF" date="1243596585"]You have a typo in one of your files.[/quote]

uhm...........

it works now
thanks to you

its 3:30am miami time
need to sleep

many many many thanks
take care

tomorrow another day




Theme © iAndrew 2016 - Forum software by © MyBB