Hi there!
I have found that there are a lot of $_SERVER variables accessible within a PHP script, that allow "access" to the HTTP header sent by the client. According to http://www.adamek.biz/php.php, the following can be used:
$HTTP_VIA
$HTTP_CLIENT_IP
$HTTP_PROXY_CON NECTION
The above are pretty clear and I have no problems with them... but then:
$HTTP_X_FORWARD ED_FOR
$FORWARDED_FOR
$X_FORWARDED_FO R
$X_HTTP_FORWARD ED_FOR
$HTTP_FORWARDED
Now my question is, why in the world are there so many "FORWARDED" headers? Wouldn't ONE variable/header line suffice? Or were the PHP/RFC guys a bit bored and tried to come up with a nice solution to confuse innocent developers? :P
I have googled for all of those, but opinions seem to differ on what header line should be taken into account and what header line shouldn't.
So,
1) Why are there so many possible headers? Are some of them obsolete?
2) What is the difference between those headers with a 'X' and those which lack the 'X'?
3) What is the difference between "FORWARDED_ FOR" and just "FORWARDED" ?
Thanks in advance for any help!!! :)
I have found that there are a lot of $_SERVER variables accessible within a PHP script, that allow "access" to the HTTP header sent by the client. According to http://www.adamek.biz/php.php, the following can be used:
$HTTP_VIA
$HTTP_CLIENT_IP
$HTTP_PROXY_CON NECTION
The above are pretty clear and I have no problems with them... but then:
$HTTP_X_FORWARD ED_FOR
$FORWARDED_FOR
$X_FORWARDED_FO R
$X_HTTP_FORWARD ED_FOR
$HTTP_FORWARDED
Now my question is, why in the world are there so many "FORWARDED" headers? Wouldn't ONE variable/header line suffice? Or were the PHP/RFC guys a bit bored and tried to come up with a nice solution to confuse innocent developers? :P
I have googled for all of those, but opinions seem to differ on what header line should be taken into account and what header line shouldn't.
So,
1) Why are there so many possible headers? Are some of them obsolete?
2) What is the difference between those headers with a 'X' and those which lack the 'X'?
3) What is the difference between "FORWARDED_ FOR" and just "FORWARDED" ?
Thanks in advance for any help!!! :)
Comment