include - PHP require path - same directory -


i have index.html in root , supporting files in /html. have google analytics code in file in html directory. works index.html code in between head tags...

<?php require('html/googleanalytics.html'); ?> 

but not in of supporting files in html directory, same directory file i'm trying require/include code...

<?php require('googleanalytics.html'); ?> 

from php.net "...include check in calling script's own directory , current working directory before failing"

what doing wrong?

from php 5.3 (which @ time after end of life cycle) , later can use __dir__ constant , http://php.net/manual/en/language.constants.predefined.php

require(__dir__ . '/googleanalytics.html'); 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo