Welcome Guest, Not a member yet? Register   Sign In
403 error access denied
#1

Hi everyone !

I'm a beginer with codeigniter and I have a problem with an 403 error : You don't have permission to access /b-best/application/controllers/InscriptionController.php on this server.

Actually, my default view (homePage.php) is working, I can display it but the problem is on a link.

In my HomePageView.php I have <a href="InscriptionController.php"> Subscription </a> and in this controller I load the view like this : $this->load->view('RegistrationView.php');

The 403 error happens now. I don't know what I have to do. My config file is ok, my $config['base_url'] is 'http://localhost/b-best/'; my $route['default_controller'] is the HomeController.php and my database.php is correctly configurated.

If you have any idea about what to do, it would be really helpfull to tell it to me.


Axel
Reply
#2

change:

<a href="InscriptionController.php"> Subscription </a>

to:

<a href="<?php echo site_url('inscriptioncontroller'); ?>"> Subscription </a>
"I reject your reality and substitute my own" - Adam Savage, M5 Inc.
Reply
#3

Waw !!! It works !

Thank you so much man ! 4 days lost at that job ! Thanks to you it's fixed, thank you a lot !

Axel
Reply
#4

glad to be of help Smile
"I reject your reality and substitute my own" - Adam Savage, M5 Inc.
Reply
#5

The following is even more CI compliant:

PHP Code:
<?= anchor('inscriptioncontroller','Subscription');?>
The anchor helper function automatically adds the reference to your site's url.
It requires loading the url helper, but it's good practice to do that by default in autoload.php.

<?= is short for <?php echo
Reply




Theme © iAndrew 2016 - Forum software by © MyBB