Welcome Guest, Not a member yet? Register   Sign In
need help
#1

[eluser]ebot[/eluser]
i am building a weblog using CI
i got probe with the edit;
here is the on the view
function edit($post_id)
{
$data['css'] = $this->css;
$data['base'] = $this->base;
$data['title']="My Blog CMS Navigation Page";
$data['heading']="Blog CMS";
$data['posts']= $this->Blog_model->get($post_id);

$this->load->view('edit', $data);

when i added some codes on the view side indorder to edit the post
i get just empty fields
here is the codes for the view:

<?php echo $this->validation->error_string; ?>

<?php foreach ($posts as $field): ?>

<?php echo form_open('admin/update'); ?>
<p>Title: &lt;input type="text" name="&lt;?php echo $field-&gt;title;?&gt;" size="40"/></p>
<p>Date-Time: &lt;input type="text" name="&lt;?php echo $field-&gt;postdate;?&gt;" size="40"/> yyyy-mm-dd hh:mm</p>
<p>Summary: <br/>&lt;textarea name="&lt;?php echo $field-&gt;summary;?&gt;" rows="5" cols="50">&lt;/textarea&gt;&lt;/p><br/>
<p>Post:<br/>&lt;textarea name="&lt;?php echo $field-&gt;post;?&gt;" rows="15" cols="50">&lt;/textarea&gt;&lt;/p>
<p>&lt;input type="submit" value="Update Post"&gt;&lt;/p>
&lt;?php endforeach; ?&gt;
&lt;/form&gt;


i will need help to work this out
#2

[eluser]vickel[/eluser]
try to get &lt;?php echo form_open('admin/update'); ?&gt; out of the loop
regards
Vickel




Theme © iAndrew 2016 - Forum software by © MyBB