Welcome Guest, Not a member yet? Register   Sign In
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.




Theme © iAndrew 2016 - Forum software by © MyBB