|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
            Thank you for your help!
            If the status of the bug report you submitted changes, you will be notified.
            You may return here and check the status or update your report at any time. The URL for your bug report is: https://bugs.php.net/bug.php?id=39450. 
  [2006-11-09 14:30 UTC] patrik dot mayer at i12 dot de
 Description:
------------
The getenv() function fills the $_POST-Array for every variable that it gets from the environment. So, if you want to getenv "HTTP_HOST" you will have $_POST['HTTP_HOST'] filled after the getenv() Statement.
Reproduce code:
---------------
<?php
echo "<pre>".print_r($_POST, true)."</pre><br/><br/>";
echo getenv('SERVER_PROTOCOL').'<br/>';
echo getenv('REMOTE_PORT').'<br/>';
echo "<br/>";
echo "<pre>".print_r($_POST, true)."</pre>";
?>
Expected result:
----------------
Array
(
)
HTTP/1.1
4175
Array
(
)
//tested on PHP 5.1.6
Actual result:
--------------
Array
(
)
HTTP/1.1
4175
Array
(
    [HTTP_HOST] => development.i12.de
    [SERVER_PROTOCOL] => HTTP/1.1
    [REMOTE_PORT] => 4175
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 20:00:01 2025 UTC | 
I am getting a similar behavior where calling getenv() is populating the $_FILES global: <? var_dump($_FILES); echo "<br>\n"; $h = getenv('DOCUMENT_ROOT'); var_dump($_FILES); ?> yields: array(0) { } array(0) { } array(1) { ["DOCUMENT_ROOT"]=> string(26) "/usr/csite/WebServer/html/" } This is PHP 5.2.0 on Redhat Enterprise Linux 4.