Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Apache-specific Functions : apache_getenv

apache_getenv

Get an Apache subprocess_env variable (PHP 4 >= 4.3.0, PHP 5)
string apache_getenv ( string variable [, bool walk_to_top] )

Example 203. apache_getenv() example

The example above shows how to retrieve the value of the Apache environment variable SERVER_ADDR.

<?php
$ret
= apache_getenv("SERVER_ADDR");
echo
$ret;
?>

The above example will output something similar to:

42.24.42.240

Code Examples / Notes » apache_getenv

hela

Very easy but VERY cool to use:
For an index.php that will be installed on many servers that are installed in a web without DNS, the page should point to the server itself and, for example for a cups-webinterface to port 631. So, let´s do it:
<a href="/testdir/">testlink</a>
<a href="http://<? echo apache_getenv("SERVER_ADDR"); ?>:631/">Cups Webinterface</a>
Have a lot of fun . . .
Hela


Change Language


Follow Navioo On Twitter
apache_child_terminate
apache_get_modules
apache_get_version
apache_getenv
apache_lookup_uri
apache_note
apache_request_headers
apache_reset_timeout
apache_response_headers
apache_setenv
ascii2ebcdic
ebcdic2ascii
getallheaders
virtual
eXTReMe Tracker