A while ago I attempted to re-open previous work but could not get the XAMPP Control Panel to open, I guess because I re-installed Windows 10. I then decided to download the latest versions of XAMPP & CodeIgniter and then transfer my previous files to the new system.
Previous CI_VERSION = '3.1.1' - Latest CI_VERSION = '3.1.9' - Previous PHP version: 7.0.8 - Latest PHP version 7.2.3
When my current system directs to the "username" page which is where the username & password are created, I get the following error. This function was working OK in my previous system. It appears to be caused by a difference between the versions of PHP.
A PHP Error was encountered Severity: Warning
Message: Use of undefined constant BASE_URL - assumed 'BASE_URL' (this will throw an Error in a future version of PHP)
Filename: username.php Line Number: 47
This is Line 47
<form class="form" method="post" action="<?php echo BASE_URL . 'username'; ?>">
Backtrace:
File: C:\xampp\htdocs\application\views\username.php Line: 47 Function: _error_handler This is Line 47 - ">
File: C:\xampp\htdocs\application\controllers\Username.php Line: 70 Function: view This is Line 70 - $this->load->view('username', $data);
File: C:\xampp\htdocs\index.php Line: 315 Function: require_once BASE_URLusername"> This is Line 315 - require_once BASEPATH.'core/CodeIgniter.php';
Can somebody advise me of what I need to change?
Update 1
The only place I can find a definition of base_url is in /config/config.php which is following;
$config['base_url'] = 'http://localhost/';
And that has not been changed between my previous work and this current system.
Update 2
In the Controller Username.php there is a load function
$this->load->helper(array('form', 'url'));
But I can't find anything in the helper folder other than index file.
And again that has not been changed between my previous work and this current system.