CodeIgniter Forums

Full Version: Premature end of script headers on form submission
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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 ?