Как делают валидацию на Codeigniter в PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
$room=$this->input->post('room'); $broom=$this->input->post('broom'); $hall=$this->input->post('hall'); $troom=$this->input->post('troom'); $park=$this->input->post('park'); $floor=$this->input->post('floor'); $amen=str_replace("\'", "'", $this->input->post('amen')); $rmark=str_replace("\'", "'", $this->input->post('rmark')); $face=$this->input->post('face'); $leven=$this->input->post('leven'); $twel=$this->input->post('twel'); //$uid = $_SESSION['id']; $date=date('d-m-Y'); if(empty($room))$room='0'; if(empty($broom))$broom='0'; if(empty($hall))$hall='0';if(empty($troom))$troom='0'; if(empty($floor))$floor='0'; if(empty($park))$park='Not updated'; if(empty($amen))$amen='Not updated'; if(empty($rmark))$rmark='Not updated'; if(empty($l1))$l1='Not updated'; if(empty($l2))$l2='Not updated'; if(empty($face))$face='Not updated'; if($ptype == 'Land' || $ptype == 'Commercial Property')$bhk=0; if (empty($tit) || empty($loc) || empty($lmark) || empty($zone) || empty($area)|| empty($price) || empty($aa) || empty($ptype) || empty($pfrom) || empty($bank) || empty($nc) || empty($br)) { $this->session->set_flashdata('field','*Please fill all the required fields'); redirect("edit_property/admin_edit/$id"); //redirect('edit_property'); } |