Hi guys,
i am new to codignitor. I can’t able to get my controller to work.
i spent half a day now. i am having a hard time with the error “No direct script access allowed”.
Please help me to resolve this issue.
Trouble Shooting
i tested the base path and it shows the path correctly.
i just added
echo base_url();
to hosting.xxxweb.xyz/public/index.php**
and iscorrectly printing the project folder as shown below.
https://hosting.xxxweb.xyz/public
Customers.php Controller
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Customers extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->helper('url', 'form');
$this->load->library('form_validation');
}
public function index() {
$this->load->view('header');
$this->load->view('footer');
}
View
View folder has header.php and footer.php files. Which should be loading when Customers Controller is called.
So when executed the URL https://hosting.xxxweb.xyz/public/customers/index
the error is appring.