include/require in php
Method 1.
Use Absolute path with respect to file system(Not Server root). Best way is to Append file name with $_SERVER['DOCUMENT_ROOT']" or $_SERVER[DOCUMENT_ROOT'"
For example:
include $_SERVER['DOCUMENT_ROOT']."/htdocs/project/conf.php"
where "/htdocs/project/" is the path of conf.php with respect to server root.
Method 2.
To include the files, path of the file should be in the include path inside php.ini or file should be in same directory.Consider, for example, the following include path, which I use in my php.ini file ;
No comments:
Post a Comment
Any Suggeston or Query ?