0

I am working on the Codeigniter project, I downloaded the code from the server to work on locally (XAMPP server) but when I try to change the base_url(), it is not even updating. like here:

| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://localhost/project/';

/* 

but when I open the project in Browser:

<form action="<?php echo base_url();?>login_alert/login_verify_alert/>

it returns the old base_url() and redirects the project to the server.

<form action="https://project.com/app/login_alert/login_verify_alert//" method="POST" class="md-float-material form-material">

What am I doing wrong here?

Danish Ali
  • 2,354
  • 3
  • 15
  • 26

2 Answers2

0

update $autoload['helper'] = array('url')

base_url() function not working in codeigniter

Danish Ali
  • 2,354
  • 3
  • 15
  • 26
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 06 '21 at 09:44
0

Perhaps your local server is caching the previous page, you can append ?t=RANDOM__NUMBER to the URL to force it to produce an uncached version of the page. Example:

https://project.com/app/login_alert/login_verify_alert?t=231231

Or use inspect tools and check 'Disable Cache'.

Secondly you should use site_url() when referencing controllers, base_url is generally for file system functions such as loading a CSS file, or JS file.

Enoch
  • 921
  • 6
  • 15