[eluser]Fenix[/eluser]
I'm doing a simple "delete post" functionality that has a confirmation form and I am getting an internal server error. I use MediaTemple hosting. All my other similar scripts are working fine. If anybody can help me figure this out, that would be great. Thanks.
Quote:Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.0.54 Server at mywebsite.com Port 80
here are my controller functions
Code:
function delete_post($id = '')
{
$this->load->model('posts');
if($id != '')
{
// Confirmation Page
$data['dpost']['id'] = $id;
$data['dpost']['title'] = $this->posts->get_post_atr('title',$id);
$data['page_title'] = $this->config->item('title').': Confirm Delete Post';
$data['left_col'] = $this->load->view('admin/anav_view',$data,true);
$data['center_col'] = $this->load->view('admin/dpost_view',$data,true);
$this->load->view('template_view',$data);
}
else
{
echo 'no id specified';
}
}
function delete_post_process()
{
$this->load->model('posts');
if ($this->input->post('submitted'))
{
// Delete Post
$dpost_id = $this->input->post('delete_id');
$this->posts->delete_post($dpost_id);
redirect('admin/dashboard/post_deleted','refresh');
}
else
{
echo 'missing post data';
}
}
function post_deleted()
{
$data['page_title'] = $this->config->item('title').': Post Deleted';
$data['left_col'] = $this->load->view('admin/anav_view',$data,true);
$data['center_col'] = $this->load->view('admin/dcpost_view',$data,true);
$this->load->view('template_view',$data);
}
here are my model functions which i think aren't a problem
Code:
function get_post_atr($atr, $post_id)
{
$this->db->select($atr);
$this->db->where('post_id', $post_id);
$this->db->limit(1);
return $this->db->get('posts')->result();
}
function delete_post($post_id)
{
$this->db->where('post_id', $post_id);
$this->db->update('posts', array('status' => 'deleted'));
}