No direct script access allowed - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: No direct script access allowed (/showthread.php?tid=58664) |
No direct script access allowed - El Forum - 07-04-2013 [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 No direct script access allowed - El Forum - 07-05-2013 [eluser]InsiteFX[/eluser] Look at the .html file in that directory and you will see why your getting that Error. |