Server and execution environment information
Basic usage:
{{ url.server }}
Usage with parameters:
{{ url.server(Option) }}
Parameters:
Option
(optional) – Select what information to return.- REMOTE_ADDR – (REMOTE_ADDR. The IP address from which the user is viewing the current page. .)
- HTTP_REFERER – (HTTP_REFERER. The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted..)
- REMOTE_HOST – (REMOTE_HOST. The Host name from which the user is viewing the current page. The reverse dns lookup is based off the REMOTE_ADDR of the user..)
- REMOTE_PORT – (REMOTE_PORT. The port being used on the user’s machine to communicate with the web server. .)
- REMOTE_USER – (REMOTE_USER. The authenticated user..)
- PHP_SELF – (PHP_SELF. The filename of the currently executing script, relative to the document root..)
- GATEWAY_INTERFACE – (GATEWAY_INTERFACE. Revision of the CGI specification the server is using; i.e. ‘CGI/1.1’.)
- SERVER_ADDR – (SERVER_ADDR. The IP address of the server under which the current script is executing..)
- SERVER_NAME – (SERVER_NAME. The name of the server host under which the current script is executing. If the script is running on a virtual host, this will be the value defined for that virtual host..)
- SERVER_SOFTWARE – (SERVER_SOFTWARE. Server identification string, given in the headers when responding to requests..)
- SERVER_PROTOCOL – (SERVER_PROTOCOL. Name and revision of the information protocol via which the page was requested; i.e. ‘HTTP/1.0’.)
- REQUEST_METHOD – (REQUEST_METHOD. Which request method was used to access the page; i.e. ‘GET’, ‘HEAD’, ‘POST’, ‘PUT’..)
- REQUEST_TIME – (REQUEST_TIME. The timestamp of the start of the request. Available since PHP 5.1.0..)
- REQUEST_TIME_FLOAT – (REQUEST_TIME_FLOAT. The timestamp of the start of the request, with microsecond precision. Available since PHP 5.4.0..)
- QUERY_STRING – (QUERY_STRING. The query string, if any, via which the page was accessed. .)
- DOCUMENT_ROOT – (DOCUMENT_ROOT. The document root directory under which the current script is executing, as defined in the server’s configuration file..)
- HTTP_ACCEPT – (HTTP_ACCEPT. Contents of the Accept: header from the current request, if there is one..)
- HTTP_ACCEPT_CHARSET – (HTTP_ACCEPT_CHARSET. Contents of the Accept-Charset: header from the current request, if there is one. Example: ‘iso-8859-1,*,utf-8’..)
- HTTP_ACCEPT_ENCODING – (HTTP_ACCEPT_ENCODING. Contents of the Accept-Encoding: header from the current request, if there is one. Example: ‘gzip’..)
- HTTP_ACCEPT_LANGUAGE – (HTTP_ACCEPT_LANGUAGE. Contents of the Accept-Language: header from the current request, if there is one. Example: ‘en’..)
- HTTP_CONNECTION – (HTTP_CONNECTION. Contents of the Connection: header from the current request, if there is one. Example: ‘Keep-Alive’. .)
- HTTP_HOST – (HTTP_HOST. Contents of the Host: header from the current request, if there is one. .)
- HTTP_USER_AGENT – (HTTP_USER_AGENT. Contents of the User-Agent: header from the current request, if there is one. This is a string denoting the user agent which is accessing the page. A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with get_browser() to tailor your page’s output to the capabilities of the user agent..)
- HTTPS – (HTTPS. Set to a non-empty value if the script was queried through the HTTPS protocol..)
- REDIRECT_REMOTE_USER – (REDIRECT_REMOTE_USER. The authenticated user if the request is internally redirected. .)
- SCRIPT_FILENAME – (SCRIPT_FILENAME. The absolute pathname of the currently executing script..)
- SERVER_ADMIN – (SERVER_ADMIN. The value given to the SERVER_ADMIN (for Apache) directive in the web server configuration file. If the script is running on a virtual host, this will be the value defined for that virtual host. .)
- SERVER_PORT – (SERVER_PORT. The port on the server machine being used by the web server for communication. For default setups, this will be ’80’; using SSL, for instance, will change this to whatever your defined secure HTTP port is..)
- SERVER_SIGNATURE – (SERVER_SIGNATURE. String containing the server version and virtual host name which are added to server-generated pages, if enabled..)
- PATH_TRANSLATED – (PATH_TRANSLATED. Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping..)
- SCRIPT_NAME – (SCRIPT_NAME. Contains the current script’s path. This is useful for pages which need to point to themselves. The __FILE__ constant contains the full path and filename of the current (i.e. included) file. .)
- REQUEST_URI – (REQUEST_URI. The URI which was given in order to access this page; for instance, ‘/index.html’..)
- PHP_AUTH_DIGEST – (PHP_AUTH_DIGEST. When doing Digest HTTP authentication, this variable is set to the ‘Authorization’ header sent by the client (which you should then use to make the appropriate validation). .)
- PHP_AUTH_USER – (PHP_AUTH_USER. When doing HTTP authentication, this variable is set to the username provided by the user..)
- PHP_AUTH_PW – (PHP_AUTH_PW. When doing HTTP authentication, this variable is set to the password provided by the user. .)
- AUTH_TYPE – (AUTH_TYPE. When doing HTTP authentication, this variable is set to the authentication type. .)
- PATH_INFO – (PATH_INFO. Contains any client-provided pathname information trailing the actual script filename but preceding the query string, if available. For instance, if the current script was accessed via the URL https://www.example.com/php/path_info.php/some/stuff?foo=bar, then $_SERVER[‘PATH_INFO’] would contain /some/stuff. .)
- ORIG_PATH_INFO – (ORIG_PATH_INFO. Original version of ‘PATH_INFO’ before processed by PHP..)
Example:
{{ url.server("REMOTE_ADDR") }}
Leave a Reply
You must be logged in to post a comment.