Is there a similar command in php simulating command in Classic ASP “include virtual” that can be applied in the command ‘file’ or ‘include’ to guide the opening of files?
I use a Windows Host not Apache.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ASP’s
#includedirective allowsfileorvirtualoptions, which include files using a path either relative to the current file or relative to the site root, respectively.(More info can be found here: http://www.w3schools.com/asp/asp_incfiles.asp) (and yes, I dislike w3schools as much as the next guy here, but it was the clearest explanation I could find in a hurry; feel free to replace it if you know a better one)
PHP’s
include()function (andinclude_once(),require()andrequire_once()) doesn’t differentiate this way. If you want to include a file using a directory relative to the virtual server root, you need to use$_SERVER['DOCUMENT_ROOT']in your include path. ie:See the PHP manual page for more info: http://php.net/manual/en/function.include.php and http://php.net/manual/en/reserved.variables.server.php