![]() |
help me about CI + Jquery mobile - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: help me about CI + Jquery mobile (/showthread.php?tid=48152) |
help me about CI + Jquery mobile - El Forum - 01-06-2012 [eluser]firexas[/eluser] hello all, i'm newbie on codeigniter and i build web mobile version with CI(2.0)and jquery mobile 1.0. my question.. how to upload my image files like jpeg,gif and others on my source code?! i try with CI without jquery mobile.sucess but with jquery mobile not sucess. why? this my sourcode. //controller. function save_article() { $this->load->library("upload"); $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'jpeg|gif|jpg|png'; $config['max_size'] = '10000'; $config['max_width'] = '1024'; $config['max_height'] = '1768'; $this->upload->initialize($config); $field_name = "foto"; if (!$this->upload->do_upload($field_name)) { $upload_error = array("error" => $this->upload->display_errors()); print_r($upload_error); //$this->load->view("form_insert_siswa", $upload_error); } else { $upload_data = $this->upload->data(); $rec_data = array("nmbio" => $this->input->post("namabio"), "isi" => $this->input->post("article"), "gbr" => $upload_data["full_path"]); $this->db->insert("review", $rec_data); } //view <div data-role="collapsible" data-theme="b" data-content-theme="d"> <h3 id="according_sent_article">Kirim Article Biologi</h3> <p id="kirim_article"> <?php echo form_open_multipart('mobile/save_article','name="f_article"') ?> <ul> <label for='namabio'>NameBiologi :</label> <input type='text' name='namabio' id='namabio' value='' /> <label for='article'>Article :</label> <textarea name="article" id="article"> </textarea> <label for='foto'> Image :</label> <input type="file" name="foto" id='foto' value=''> </ul> <a class='mybutton' data-role="button">sent Article Biologi</a> </form> //mobile.js $(document).bind("mobileinit", function(){ $.mobile.loadingMessage = "Mohon tunggu..."; }); function simpan_article() { $('#info-content').text('Loading...'); var namabio = $('#namabio').val(); $('label[for=namabio]').removeClass('error'); if(namabio == '') { $('label[for=namabio]').addClass('error'); } else { send_form(document.f_article,'mobile/save_article'); } } .. my source code like that.help me? thanks b4 and sory my english not good. |