Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->form_validation->set_rules('li_article', 'Artikel', 'trim|required');
- $this->form_validation->set_error_delimiters('<font color="red">', '</font>');
- if ($this->form_validation->run() == FALSE)
- {
- //errors input type
- $data['penulis'] = $this->penulis_model->getAllPenulis();
- $data['gereja'] = $this->gereja_model->getAllPenulis();
- $this->template->load('template','user/adminlin/tambah',$data);
- }
- else
- {
- /setting configuration uploads
- $config['upload_path'] = './uploads/lintas';
- $config['allowed_types'] = 'gif|jpg|png';
- $config['max_size'] = '500';
- $config['max_width'] = '1024';
- $config['max_height'] = '768';
- $this->upload->initialize($config);
- //check if upload images
- if(!$this->upload->do_upload('foto'))
- {
- //errors shown
- }
- else
- {
- $image_info = getimagesize($_FILES["foto"]["tmp_name"]);
- $image_width = $image_info[0];
- $image_height = $image_info[1];
- if (($image_height=='600') and ($image_width=='600'))
- {
- //eksekusi insert to table
- }
- else
- {
- echo "images should match width and height!";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement