how to receive response from ajax call with sencha touch from codeigniter / ExtJS -


i trying response codeigniter when send ajax request sencha touch/ ext with

ext.ajax.request({//       url: formbase.url, //something 'http://path.to/mobile/login/ajax_validatelogin',       success:  function(response, opts) {                     console.log('login success!');                     console.log('data: ' + response.responsetext);                 },       failure:  function(result){                     console.log('login error! ');                                    },        method: 'post',       params: form.getvalues() }); form = new ext.form.formpanel(formbase); //... 

and in codeigniter like

function ajax_validatelogin() {      $username = $this->input->post('username');      $password = $this->input->post('password');     $data['username'] = 'arschkarte'; //$username;       if($username == "f"){         $data["success"] = true;     } else {         $data["success"] = false;         $data["errors"]["reason"] = "login failed. try again.";     }     $this->load->view('mobile/loginmobile', $data); } 

and view

<?php      echo 'username: '.$username; ?> 

i allways error "login failed" , response of post allways empty (while parameters send correctly)

any ideas? thnx!!!


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -