• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Premature end of script headers on form submission

Hi guys, I'm receving a 500 Internal Server error on form submission.

The form uses post as method and the action is on the same page. It's address is

where edit is the controller method and the id is a numeric parameter.

function edit($id)


            $this->form_validation->set_rules(Category::NAME, Category::NAME, 'trim|required|alpha_dash');
            $this->form_validation->set_rules(Category::PERCENTAGE, Category::PERCENTAGE, 'trim|required|numeric');
            $this->form_validation->set_rules(Category::AVAILABLE, Category::AVAILABLE, 'trim|numeric');
                $category_array = array(
                    Category::CATID =>  $id,
                    Category::NAME  =>  $this->form_validation->set_value(Category::NAME),
                    Category::PERCENTAGE  =>  $this->form_validation->set_value(Category::PERCENTAGE),
                    Category::AVAILABLE  =>  $this->form_validation->set_value(Category::AVAILABLE) ? 1 : 0,
                    $data['message'] = array('type' =>  'success', 'message' => 'ok message');
                    $data['message'] = array('type' =>  'error', 'message' => 'not ok message');
                $data['message'] = array('type' =>  'error', 'message' => 'not ok message');


        $data['category'] = $this->category->get_category($id);

        $output = $this->load->view('common/header', $data, true);
        $output .= $this->load->view('categories/edit', $data, true);
        $output .= $this->load->view('common/footer', $data, true);


As you can see the script is very simple, and I figured out that the run method of form validation library is what is giving me the problem. In particular if I comment the if out it runs well also if in the run method I comment out the return line :O

Any idea on what it could be the problem ?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.