我有表單驗證這樣的:驗證假,雖然數據充滿
function insert() {
$this->form_validation->set_message('required', '*column must be filled');
$this->form_validation->set_rules('judul', 'Judul', 'required');
$this->form_validation->set_rules('isi', 'Isi', 'required');
if ($this->form_validation->run() == FALSE) {
$this->layout->addJs('ckeditor/ckeditor.js');
$this->layout->addJs('js/admin/b267648789c30a07b0efa5bce7bdd9fe.js');
$this->layout->view('admin/admin_view/insertAdmin_view');
} else {
$data = array(
'title' => $this->input->post('judul'),
'content' => $this->input->post('isi'),
);
$this->db->insert('newses', $data);
... other proses ...
}
}
雖然我填寫的數據表單中添加數據(我用的CKEditor添加數據),條件總是假的,所以它不會增加我想要的數據。但是如果我添加了一些html數據,卻出現了錯誤,但是如果我添加了正常的數據文本,它就很好用了。再一次當我在localhost xampp上運行我的程序時,這一切都有效,但是當我使用託管時發生。 有什麼建議嗎? 感謝您的所有建議。
的錯誤,您是否獲得了CKEditor的值(在CKEditor的文字)的崗位價值? –
但我認爲這不是問題,導致本地主機工作良好。在主機中是否有ckeditor的其他配置? – Cha
請注意,代碼在localhost中運行,而不是在活動服務器上運行...檢查您是否在活動服務器上獲得ckeditor值。 –