Welcome Guest, Not a member yet? Register   Sign In
internal server error
#1

[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'));
}
#2

[eluser]Mike Ryan[/eluser]
Can you post the relevant lines from the apache error log file?
#3

[eluser]Fenix[/eluser]
[Sun Nov 02 13:00:16 2008] [error] [client 555.55.555.55] malformed header from script. Bad header=Post Deleted: php5, referer: http://mysite.com/admin/dashboard/delete_post/8
#4

[eluser]Fenix[/eluser]
omg...

Code:
<?= header('Post Deleted',2) ?>

should have been:
Code:
<?= heading('Post Deleted',2) ?>


problem solved. thanks for the help...i took a second look at the apache error log and looked right over what should have been obvious.
#5

[eluser]Mike Ryan[/eluser]
I didn't really do anything, but you are welcome anyway :cheese:




Theme © iAndrew 2016 - Forum software by © MyBB