Hi,
I am building a web site and have included files that get used from the root and different sub directories within my site. For example:
<link rel="stylesheet" href="<?php echo $_SERVER['DOCUMENT_ROOT']; ?>/css/style.css">
These are the outputs of $_SERVER['DOCUMENT_ROOT']:
Testing server (http://localhost/mywebsite):
C:/xampp/htdocs/mywebsite
Share host server (http://www.mywebsite.com):
/home/mywebsite/public_html
How to define the above path correctly to work both on testing and hosting server?