define('BASE_URL', "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
The current base_url
"http://training:8888/php/PHP6:MySQL%205/16/user_registration/htdocs/test.php/index.php"
I've used:
echo(BASE_URL . '/index.php' . "<br />"); // Define the URL: echo str_ireplace('htdocs/','', BASE_URL ); //Not the desired result
and arrived at:
"http://training:8888/php/PHP6:MySQL%205/16/user_registration/test.php"
I'm having issues, adapting the str_ireplace() function to remove all segments after
"htdocs" so another uri can be appended:
$url = BASE_URL . '/somepage.php'; // Define the URL:
"http://training:8888/php/PHP6:MySQL%205/16/user_registration/htdocs/somepage.php."//Desired result
Happy New Year!