PHP

PHP Programming

What are the useful fields of $_SERVER array in PHP

The following table describes useful fields in $_SERVER array in PHP.

Name Description PHP_SELF Returns the filename of the current script SERVER_PROTOCOL Name and revision of the information protocol ‘HTTP/1.0‘ or ‘HTTP/1.1′ REQUEST_METHOD Returns the request method used to access (GET/POST/PUT) REQUEST_TIME Returns the timestamp from the beginning DOCUMENT_ROOT Returns the root directory under which the current script is executing. This directory is based on server’s configuration. HTTP_REFERER Returns the page address that referred HTTP_USER_AGENT Returns the contents of user agent extracted from HTTP header. This information is typically used for identification of user’s browser and operating system. REMOTE_ADDR Returns the More >