[eluser]xwero[/eluser]
just put
Code:
$this->load->view('admin/content_add', $data);
below the ifs and you will be fine.
I recommend you do it in a loop instead of 3 hardcoded ifs
Code:
$fields = array('pdf1','pdf2','pdf3');
foreach($fields as field)
{
if (!$this->upload->do_upload($field))
{
$data['error_'.$field] = $this->upload->display_errors('<div class="warning">', '</div>');
}
else
{
$uploads = $this->upload->data();
$data_insert = array(
'title' => $uploads['orig_name'] ,
'pdf_name' => $uploads['orig_name'] ,
'content_Id' => $new_id
);
$this->db->insert('pdf', $data_insert);
}
}
$this->load->view('admin/content_add', $data);
This way you only have to remove an array value instead of a whole control structure.