[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> <?php echo $heading; ?> </h1>
<?php if($query->num_rows() >0 ): ?>
<?php foreach($query->result() as $row ): ?>
<h3><?php echo $row->body; ?></h3>
<p><?php echo $row->author; ?></p>
<hr>
<?php endforeach; ?>
<?php endif; ?>
<p><?php echo anchor('blog','Back to Blogs'); ?></p>
<?php echo form_open('blog/comment_insert/'); ?>
<?php form_hidden('entry_id',$this->uri->segment(3)); ?>
<p><textarea name="body" rows="10"></textarea></p>
<p><input type="text" name="author"></p>
<p><input type="submit" value="Submit Comment"></p>
</form>
</body>
</html>
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?