If I should point to a directory from everywhere in the site which is the best procedure?
$folder = "http://www.mysite.com/something/foldertopoint"
or
$folder = "/WEB/mysite/htdocs/something/foldertopoint"
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.
Why not use something like
__DIR__it is a magical constant. If you define a path in say a config filePath to config file:
/var/www/include/config.phpinside you have say
Anywhere you use the constant
_INC_will always point to/var/www/includeso if you are in:
/var/www/some/crazy/path/of/nonsense.phpYou can simply use
which will include
/var/www/include/myinclude.phpsaves time when trying to include folers/files site-wide.