你好我有一個論壇,當用戶創建一個評論,我想,如果他沒有輸入任何我想告訴他一個錯誤,他必須輸入的東西:)但我不知道如何把他線程他在不在。codeigniter驗證
我有這個
if($this->_submit_validate_comment() == false) {
$this->post(); return;
}
function _submit_validate_comment() {
$this->form_validation->set_rules('kommentar', 'kommentar', 'required|min_length[4]');
return $this->form_validation->run();
}
在您的重定向方法,則需要使用/論壇/後/」一起。 $ this-> input-> post('id'),你的基地址是localhost:8888/ci /。這可能是一個URL的問題。嘗試添加base_url()。 '/ forum/post /'....到你的重定向,看看是否有幫助。我可能是錯的,但嘗試將uri段從3改爲4,以防萬一,或者更好地回顯$ this-> uri-> segment(3)的值,以確保獲得正確的值。 – 2010-12-21 19:02:03