• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No direct script access allowed

#1
[eluser]Unknown[/eluser]
guys why im getting in alert response ajax: No direct script access allowed
//--------------------------view with js included
$.ajax({
type: "POST",
url: "<?php echo base_url('login/checa_login'); ?>",
data: $("form").serialize(),
dataType: "text",
success: function(data) {alert(data);



}

}
});
--------------------------------controller
<?php

if (!defined('BASEPATH'))
exit('No direct script access allowed');


class Login extends CI_Controller {

function __construct() {
parent::__construct();
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
}

function index() {
$dados = array(
"titulo" => "Login",
);
$this->load->view('login/login', $dados);
}

function checa_login() {
echo json_encode(array("nome"=>"server ok!")); die;
}

}
//-------------------end

can any1 help me? when its local, running ok, but in my server i see this error alert: No direct script access allowed

#2
[eluser]InsiteFX[/eluser]
Look at the .html file in that directory and you will see why your getting that Error.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.