I read the following comment on PHP doc pages :
"Be warned that most Server-Array content (even $ _SERVER ['SERVER_NAME']) is provided by the client and can be manipulated. They can also be used for injection and thus MUST be checked and processed like any other user input."
Then, I saw the topic https://stackoverflow.com/a/167189/
Can I trust this value to get the URL of my website? If I cannot trust $ _SERVER ['SERVER_NAME'], how can I get this value? What are the possible alternatives and their pro and disadvantages?
OBS: PHP 5.3 on Apache, Unix.
source share