Book HomeWeb Design in a NutshellSearch this book

18.7. Include Variables

These variables are available to the echo command, if, elif, and any program on the server invoked with the exec command:

DATE_GMT

The current date (at the server) in Greenwich Mean Time

DATE_LOCAL

The current date (at the server) 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

Contains the "unescaped" version of any search query (GET) sent by the browser. Any special characters are escaped using the backslash (\) character.

18.7.1. Other Available Variables

The following are just a few of the many standard 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 was viewing before selecting the link (or form) that accessed the SSI page or CGI script

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.)



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.