CodeIgniter Forums

Full Version: No direct script access allowed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

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