0
В моем веб-приложение, я должен загрузить image.In что проверить файл загрузки или нет, если это не загружать не показывают никакого сообщения об ошибкеСообщение об ошибке не отображается образ загрузки
вид
public function shopped()
{
$config['upload_path'] = './application/assets/images/shops';
$config['allowed_types'] = 'jpg';
$this->load->library('upload', $config);
$id=$this->input->post('shop_name');
$type=$this->input->post('type');
$this->form_validation->set_error_delimiters('<div class="error" style="color:red">', '</div>');
$this->form_validation->set_rules('shop_name','Business Type','required');
$this->form_validation->set_rules('type',' shop type','required|alpha');
if ($this->form_validation->run() == FALSE)
{
$this->viewcategories();
}
else if (!$this->upload->do_upload('userfile'))
{
$error = array('error' => $this->upload->display_errors());
$this->viewcategories($error);
}
else
{
$data = array('upload_data' => $this->upload->data());
$this->businesstype_model->getshop($id,$type);
$success_message='Successfully Added!';
$this->session->set_flashdata('success_message',$success_message);
redirect(base_url().'admin/businesstype/viewcategories');
}
}
viewcategory функция
public function viewcategories()
{
$nam=$this->input->post('name');
$rec=$this->businesstype_model->getdata();
$rec_array=array('rec_name'=>$rec);
$this->load->view('admin/header',$rec_array);
$this->load->view('admin/addshop_view',$rec_array);
$this->load->view('admin/footer',$rec_array);
}
Я хочу, чтобы отобразить сообщение об ошибке на addshop_view
сообщение об ошибке в мой еще, если условие не working..whats причину этого ..
PLZZ дают suggetion ..
где ваш 'viewcategorie()' функция и где вы хотите Displ Сообщение об ошибке ay ??? – Saty
обновить мой вопрос plzz проверить его – robins
use может использовать '$ this-> session-> set_flashdata ('success_msg', '