What are environment variables used by Web servers?
Answer: Environment variables store hidden values on a Web server. They change dynamically, such as when a new page is loaded or a form is posted. The variables can provide useful information, such as the user's IP address or Web browser type. This data is typically stored in a "hash" named $ENV and can be accessed using a Web script written in a language such as PHP or ASP.
Below are some common environment variables:
Similarly, the http_user_agent variable is commonly used by Web developers to determine what Web browser a visitor is using. This can be useful since different browsers sometimes interpret HTML and CSS in different ways. By identifying what browser each visitor is using, developers can provide custom information to different Web browsers using a single Web page.
Entered: August 10, 2009 – by Per Christensson
Next Web Question: