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?
CodePudding user response:
update $autoload['helper'] = array('url')
base_url() function not working in codeigniter
CodePudding user response:
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.