I have created a website using Xampp as local server. My problem is at the moment, that I would like to include files and set links everytime begining from the root directory.
I tried a lot of methods but still not anyone is working. :(
Have tried following in the config.php already:
$docRoot = dirname(__FILE__).'/mywebsite/';
and also $docRoot = $_SERVER["DOCUMENT_ROOT"].'/mywebsite/';
For includes it is working like this:
But it isn't working for links in HTML.
If i try something using $docRoot like:
<a href="<?=$docRoot?>index.php"></a>
the result:
C:/xampp/htdocs/mywebsite/index.php
so it doesn't redirect to the link which is set...
but it should be just: localhost/mywebsite/index.php
Sorry for my english, I'm learning it. :D
Thanks and best regards