Include Variables
These variables are available to the echo command,
if, elif, and to any program on
the server invoked with the exec command.
-
DATE_GMT The current date in Greenwich Mean Time
-
DATE_LOCAL The current date in the local time zone
-
DOCUMENT_NAME The name of the current file (excluding directories)
-
DOCUMENT_URI The (%-decoded) URL path of the current file
-
LAST_MODIFIED The last modification date and time for the current file
-
QUERY_STRING_UNESCAPED Undecoded query string with all shell metacharacters escaped with a backslash (\)
Other Available Variables
The following are just a few of the many standard Unix environment variables available to both CGI programs and Server Side Includes:
-
HTTP_ACCEPT A list of the media types the client can accept
-
HTTP_REFERER The URL of the document the client points to before accessing the CGI program
-
HTTP_USER_AGENT The browser the client is using to issue the request
-
REMOTE_ADDR The remote IP address from which the user is making the request
-
REMOTE_HOST The remote hostname from which the user is making the request (can be useful for detecting top level domain suffixes such as .com, .edu, etc.)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access