variable required default (none - you must name a variable)The name of the PHP $_SERVER entry to read, for example REMOTE_ADDR, HTTP_HOST, REQUEST_URI, or REQUEST_METHOD. The value is returned as a string exactly as the web server set it. If the named entry does not exist, the result is an empty string. Since November 2026 only the usual request and server values are given (see the allowed values below); cookies, credentials, other headers and the environment variables of the web server give an empty string.
Allowed values The usual request and server values. The most useful ones: REMOTE_ADDR (visitor IP address), HTTP_HOST (requested host name), REQUEST_URI (path and query string of the request), QUERY_STRING (query string without the leading question mark), HTTPS (non-empty when the request used HTTPS), SERVER_NAME (host name from the server configuration), HTTP_USER_AGENT (browser User-Agent), HTTP_REFERER (page that linked here, if sent), REQUEST_METHOD (GET, POST, and so on), HTTP_X_REQUESTED_WITH (XMLHttpRequest for a request sent by a script). Also given: SERVER_PORT, REQUEST_SCHEME, SCRIPT_NAME, SCRIPT_FILENAME, PHP_SELF, DOCUMENT_ROOT, REDIRECT_URL, SERVER_ADDR, SERVER_SOFTWARE, SERVER_PROTOCOL, REMOTE_PORT, REQUEST_TIME, REQUEST_TIME_FLOAT, PATH_INFO, the HTTP_ACCEPT and HTTP_SEC_FETCH headers, the client hints HTTP_SEC_CH_UA, HTTP_SEC_CH_UA_MOBILE and HTTP_SEC_CH_UA_PLATFORM, HTTP_ORIGIN, HTTP_DNT, HTTP_IF_MODIFIED_SINCE, the forwarding headers such as HTTP_X_FORWARDED_FOR, GEOIP_COUNTRY_CODE and a few more. Not given since November 2026: HTTP_COOKIE, HTTP_AUTHORIZATION, PHP_AUTH_USER, PHP_AUTH_PW, REMOTE_USER, other headers and the environment variables of the web server.