Hello Alex,

Tuesday, February 10, 2004, 8:08:11 PM, you wrote:

AH> Are you saying that it's better not to use relative paths on include(...)'s,
AH> require(...)'s and their (x)_once(...) cousins?

Relative paths are fine, so long as you have strict control over what
is calling the script and from where. They're not particularly good
coding "practise" though given the way PHP works.

AH> Why would I want to hard code a path, even if I was including additional
AH> functionality from another file?

Because if you're including it all over the place from any number of
scripts in any number of locations - the relative directory is always
going to change.

Why not just set a $basedir value somewhere and always use that in an
include/require function: include "$basedir/sub/whatever" - then no
matter where it's called from it'll never be wrong.

-- 
Best regards,
 Richard                            mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to