Hi.
I have a PHP class that creates a header for my html file.. It's included, and that file is included again.. So I thought that the dirname(__FILE__)
function could work.. But it says it can't find the stylesheet..
I'm using mamp on os x, and when I take the path that I get from dirname(__FILE__)./../stylesheets/stylesheet.css
into the terminal, the file is found.. I'm pretty sure the path is correct.
What can be the reason for this? I use dirname(__FILE__)
all the time when I include files, that works..
Thanks
EDIT: Files and directories: /data/main.php /stylesheets/stylesheet.css /public/index.php In the main.php:
public function createHeader(){ `$stylesheetpath = dirname(__FILE__) . "/../stylesheets/stylesheet.css";` `$header = "\n";` return $header }