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><br>
<a href="http://<? echo apache_getenv("SERVER_ADDR"); ?>:631/">Cups Webinterface</a><br>
Have a lot of fun . . .
Hela
apache_getenv
(PHP 4 >= 4.3.0, PHP 5)
apache_getenv — Retorna uma variável subprocess_env do Apache
Descrição
string apache_getenv
( string $variable
[, bool $walk_to_top
] )
Retorna a variável de ambiente do Apache especificada por variable.
Essa função requer Apache 2, caso contrário ela é indefinida.
Parâmetros
- variable
-
A variável de ambiente do Apache
- walk_to_top
-
Se deve ou não retorna a variável de alto-nÃÂvel disponÃÂveis em todas as camadas do Apache.
Valor Retornado
O valor da variável de ambiente do Apache se tiver sucesso, ou FALSE se falhar
Exemplos
Exemplo #1 Exemplo de uso da função apache_getenv()
O exemplo abaixo mostra como obter o valor da variável de ambiente do Apache SERVER_ADDR.
<?php
$ret = apache_getenv("SERVER_ADDR");
echo $ret;
?>
O exemplo acima irá imprimir algo similar a:
42.24.42.240
User Contributed Notes
apache_getenv
apache_getenv
hela at helawann dot de
17-Aug-2004 11:09
17-Aug-2004 11:09

apache_get_version