-2
public function index()
{
$this->load->view('home');
$this->load->model('reg', 'reg');
$reg = $this->reg->getItems();
$data['reg'] = $reg;
}
public function error()
{
$this -> form_validation -> set_rules('username', 'Lietotājvārds', 'is_unique[reg.username]', 'alpha');
$this -> form_validation -> set_rules('fname', 'Vārds', 'required', 'greater_than[3]');
$this -> form_validation -> set_rules('lname', 'Uzvārds', 'required', 'alpha_dash', 'valid_email');
$this -> form_validation -> set_rules('pw', 'Parole' , 'required');
$this -> form_validation -> set_rules('pw2', 'Atkārtotā Parole' , 'required');
$this -> form_validation -> set_rules('email', 'Emails' , 'required', 'valid_email');
$this -> form_validation -> set_rules('email2', 'Atkārtotais Emails' , 'required', 'valid_email');
$this->form_validation->set_message('required', '{field} 😌 Opā Kāda kļūda.');
if ($this->form_validation->run())
{
$reg['username'] = $this->input->post('username');
$reg['fname'] = $this->input->post('fname');
$reg['lname'] = $this->input->post('lname');
$reg['pw'] = $this->input->post('pw');
$reg['pw2'] = $this->input->post('pw2');
$reg['email'] = $this->input->post('email');
$reg['email2'] = $this->input->post('email2');
$this->load->model('reg');
$this -> reg -> saveItem($reg);
}
$this->reg_susses();
}
我該如何做出錯誤信息。還有成功的消息。 ?? 1.我去註冊他給我錯誤在同一頁我們成功的頁面。 2.當我成功註冊hes給我在第二頁的成功消息。 3.我有1個模型= reg.php 4.我有1個constroler = home.php 5. 1有2個視圖= 1 reg.php 2. = reg_susses.phpCodeigniter成功或錯誤