表格拒绝在代码点火器中提交


Form refuses to submit in Codeigniter

好吧,我对这个问题发疯了,我无法提交此表单,它只会刷新页面。

我的编码与我网站上的其他表单完全相同,工作正常。我不明白为什么它不提交!

下面是控制器:

public function edit($id)
        {
            // check for login, if logged in
            if($this->session->userdata('logged_in') == "1")
                {
                // Check usertype, if not correct, redirect
                if($this->session->userdata('usertype') == "0" || $this->session->userdata('usertype') == "1" || $this->session->userdata('usertype') == "2")
                    {
                        // if no photos are selected, redirect and show notification
                        $this->session->set_flashdata('notification_fail', '<p style="text-align:center; color:#fbfbfb;">You do not have permission to access that page!<p>');
                        redirect('/');
                    }
                else 
                    {
                        // get the copy details
                        $data['copy_details'] = $this->quickcopy_model->get_copy_details($id);

                        if ($_POST)
                            {
                                // get data from the submitted form
                                $title = $this->input->post('title', TRUE);
                                $copy = $this->input->post('copy', TRUE);
                                // update the row in the db
                                $this->quickcopy_model->edit_go($id, $title, $copy);
                                // redirect and show notification
                                $this->session->set_flashdata('notification', '<p style="text-align:center; color:#fbfbfb;">That copy was updated!<p>');
                                redirect('quick-copy');
                                die;
                            }
                        // load views
                        $this->load->view('templates/header', $data);
                        $this->load->view('quickcopy/quickcopy_edit', $data);
                        $this->load->view('templates/footer', $data);
                    }
                }
            else
                {
                    // redirect to signin page if not logged in
                    redirect('signin');
                }
        }

以及从模型中调用的函数:

public function edit_go($id, $title, $copy)
        {
            $data = array(
                   'title' => $title,
                   'copy' => $copy
                );
            $this->db->where('id', $id);
            return $this->db->update('quickcopy', $data); 
        }

最后是观点:

<? echo form_open('quickcopy/edit/'.$copy_details->id); ?>
<p>Title/tagline:</p>
<input type="text" class="Form_Input" id="title" name="title" value="<? echo $copy_details->title; ?>" />
<p style="margin-top: 10px;">Copy:</p>
<textarea id="copy" name="copy" class="Form_Textarea" style="width: 970px"><? echo $copy_details->title; ?></textarea>

<button type="submit" class="Form_SubmitButton"><p style="color: #f7f7f7; text-align: center;">Save changes</p></button>
</form>

意识到我还没有对此进行表单验证,但我有另一个表单,我使用了表单验证,它也不起作用!

对此

完全困惑了 2 天,我不明白为什么它不提交。代码对我来说都很好,还有什么其他原因可以不提交表单?我刚刚安装了SSL,但我有其他工作正常的表单,所以我假设它不是SSL。

任何帮助都是最感激的:)

好的,

我已经设法弄清楚了问题所在...最后!

基本上,我有受SSL保护的网站的某些部分,而其他部分则不受保护。我忘了将新的表单部分添加到 htaccess 文件中的 SSL 中。

现在工作。