include: host, file, service
Posted: Fri Apr 13, 2007 4:35 am
hi
I have 3 casual [s]Qs[/s] questions with the file path in the include_once();
1. current file independent:
I need to reach to a file through such a path:
http://www.somesite.com/mysite/somefile.php
but the file, which use this include at it's top, is in another directory.
when I use things like include_once('../../../current_file.php')
it sure works! but I want to path independent of the current file's path!
2. the service:
also, I don't know what service to declare to use, as this:
include_once('http://www.somehost.com/mysite/theFile.php')
is forbiden for "http://" could not be used. so what service?
3. host independence:
Can I use a combination of server variables, to make path including even
more independence of the current site place? something like using $_SERVER['DOCUMENT_ROOT']?
thank you
I have 3 casual [s]Qs[/s] questions with the file path in the include_once();
1. current file independent:
I need to reach to a file through such a path:
http://www.somesite.com/mysite/somefile.php
but the file, which use this include at it's top, is in another directory.
when I use things like include_once('../../../current_file.php')
it sure works! but I want to path independent of the current file's path!
2. the service:
also, I don't know what service to declare to use, as this:
include_once('http://www.somehost.com/mysite/theFile.php')
is forbiden for "http://" could not be used. so what service?
3. host independence:
Can I use a combination of server variables, to make path including even
more independence of the current site place? something like using $_SERVER['DOCUMENT_ROOT']?
thank you