even i have added "if ( ! defined('BASEPATH')) exit('No direct script access allowed'); " on top of controller .Actually I need to display data in div my ajax call: below is ajax call which calls Createcaptcha to get data but instead of data it response "No direct script access allowed"
$(document).ready(function(){
$.ajax({
type: "POST",
url: 'website/Createcaptcha',
success: function(data){
$("#captcha").html(data);
}
});
});
below is controller
public function Createcaptcha(){
$image = $this->captcha_model->create_image();
echo $image;
}
Response data is displayed in div as "No direct script access allowed" , It works fine on xampp localhost