Sunday, 18 August 2013

PHP require path - same directory

PHP require path - same directory

I have index.html in the root and all supporting files in /HTML. I have
Google analytics code in a file in the HTML directory. It works from my
index.html with this code in between the head tags...
<?php
require('HTML/GoogleAnalytics.html');
?>
but not in any of the supporting files in the HTML directory, same
directory as the file i'm trying to require/include with this code...
<?php
require('GoogleAnalytics.html');
?>
from PHP.net "...include will finally check in the calling script's own
directory and the current working directory before failing"
What am I doing wrong?

No comments:

Post a Comment