Hi. I'm trying to link to a stylesheet in my header file using $_SERVER["DOCUMENT_ROOT"] as follows:
<head>
<?php
print "<link href='".$_SERVER["DOCUMENT_ROOT"]."/include/style.css' rel='stylesheet' type='text/css' />";
?>
<title>eLMS</title>
</head>
Since i'm testing locally, i'm getting the path as:
<head>
<link href='C:\Users\wretrOvian\Documents\eLMS\site/include/style.css' rel='stylesheet' type='text/css' /> <title>eLMS</title>
</head>
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.8
I 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.