|
Posted by steve on 06/07/05 02:35
"Daniel Loose" wrote:
> Hello,
>
> in order to use my scripts developed at home directly after
> upload, I
> wish to define a variable $root at begin of each script in a
> way that
> it always - be it here at home or on any other computer -
> contains the
> correct path to the web docs directory. How shall I do that
> the best
> way? (At least, how do I get the local IP or hostname? Or is
> there an
> environment variable?) Grepped 4 thick books but nothing
> found...
>
> TIA, Daniel
I use php in web and batch mode, and some of the $_SERVER variables
dont work in batch mode. I use getcwd
http://ca3.php.net/manual/en/function.getcwd.php to look at the path,
and from that detect where the app is running.
--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/PHP-detect-local-host-ftopict229718.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=796276
[Back to original message]
|