My project dir structure is
/admin
L index.php
/includes
L scripts.php
L common.php
/css
/js
index.php
header.php
footer.php
...
In index.php I include /includes/scripts.php which contains references to various css files in /css dir like such:
<link rel="stylesheet" type="text/css" href="css/jquery.alerts.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
etc...
Everything works fine when including /includes/scripts.php from the document root but if I include scripts.php from inside a different dir, ie /admin, then the paths are no longer valid and the inclusion of all files referenced fails. How can I make all paths relative to document root no matter where I call them from within my project?