-1

I am facing a problem while clicking on a link. when i click on below link.. then it is working fine.

<a href="<?php echo site_url('Main_controller/chronicles') ?>" >Chronicles</a>

but after this when i click on the other link.. then the controller is repeating twice in url. for ex: when I click on this link..

<a href="<?php base_url(); ?>index.php/Main_controller/load_compliance">SEMINAIRES  <br/>PASSS</a>

then the url link change to: http://[::1]/competence/index.php/Main_controller/index.php/Main_controller/load_compliance

Tanmay
  • 13
  • 3

1 Answers1

1

You need to echo

Replace:

<a href="<?php base_url(); ?>index.php/Main_controller/load_compliance">SEMINAIRES  <br/>PASSS</a>

With:

<a href="<?php echo base_url(); ?>index.php/Main_controller/load_compliance">SEMINAIRES  <br/>PASSS</a>

OR: (if you don't want to write echo)

<a href="<?= base_url(); ?>index.php/Main_controller/load_compliance">SEMINAIRES  <br/>PASSS</a>

Update:

As @DeadManAlive pointed out and I looked it up.

Your URL like http://[::1]/index.php indicates that your $config['base_url'] in config/config.php is set to empty string.

Daniyal Nasir
  • 669
  • 7
  • 22