PHP : Document root directory backslash problem

Soil

New Member
I'm trying to link to a stylesheet in my header file using $_SERVER["DOCUMENT_ROOT"] as follows:\[code\]<head> <?php print "<link href='".$_SERVER["DOCUMENT_ROOT"]."/include/style.css' rel='stylesheet' type='text/css' />"; ?> <title>eLMS</title></head>\[/code\]Since i'm testing locally, i'm getting the path as:\[code\]<head> <link href='http://stackoverflow.com/questions/2015464/C:/Users/wretrOvian/Documents/eLMS/site/include/style.css' rel='stylesheet' type='text/css' /> <title>eLMS</title></head>\[/code\]And this is not rendering in Firefox. It does in IE however. This is obviously a validation issue. BUT, i tried the same code on a server - with the same results. :(How do i go about fixing this? The end product may or may not run on a Local server, so i need the code to be flexible.. I'm using Abyss Webserver x1 with PHP 5.2.8I must use absolute paths - because i do not want to copy the include folder to every subdirectory of the app. I need to be able to refer to it from every location.
 
Back
Top