Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addResource() {
- $this->load->library("form_validation");
- $config['upload_path'] = "./resources/";
- $config['allowed_types'] = "jpg|png|gif|ogg|avi";
- $this->load->library('upload',$config);
- $this->form_validation->set_rules("r_name","Name","required|max_length[32]");
- $this->form_validation->set_rules("r_type","Type","required");
- if (!$this->upload->do_upload('resource') || !$this->form_validation->run()) {
- $this->load->view('addresource');
- }
- else {
- $this->doAddResource($this->upload->data());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement