Standard Server Variables

How to Get Them Into Your Web Pages

Your I.P. Address Is: 38.103.63.60
Your Browser/Platform Is:
CCBot/1.0 (+http://www.commoncrawl.org/bot.html)

Back to the Home Page
Home Page

If you've ever wondered how to display your visitor's I.P. address, Browser Version or any number of other 'interesting' things on your web pages, here's how.

First, however, you must meet a few conditions.

  1. Your Web Server/Host must support "Server Side Includes" If you are not sure, ask your hosting provider.
  2. You must give the HTML file on which you want to display the Server variables the extension .shtml rather than just .html (.sht for three character extensions.) Don't Forget the "S"
  3. Once this is done, merely include the code from the left side of the table to produce the results on the right side. Yes, it looks like a Comment, and will not display locally, ONLY when you view the page on the server.
NOTE: Not all servers are set up to echo back all variables. Some hosts may choose not to provide some for security reasons and some server software may not support the full list. (This is not a complete list, merely the most common and useful.)
   This Code in This .shtml File Returns This From Our Server   
<!--#echo var="auth_type" --> (none)
<!--#echo var="content_length" --> (none)
<!--#echo var="content_type" --> (none)
<!--#echo var="date_local" --> Wednesday, 07-Jan-2009 02:45:53 CST
<!--#echo var="date_gmt" --> Wednesday, 07-Jan-2009 08:45:53 GMT
<!--#echo var="document_name" --> server_vars.shtml
<!--#echo var="document_root" --> /home/httpd/html/theeggman/
<!--#echo var="document_uri" --> /seminars/server_vars.shtml
<!--#echo var="forwarded" --> (none)
<!--#echo var="from" --> (none)
<!--#echo var="gateway_interface" --> CGI/1.1
<!--#echo var="http_cache_control" --> no-cache
<!--#echo var="http_connection" --> close
<!--#echo var="http_cookie" --> (none)
<!--#echo var="http_form" --> (none)
<!--#echo var="http_host" --> www.smartalek.com
<!--#echo var="http_referrer" --> (none)
<!--#echo var="http_ua_color" --> (none)
<!--#echo var="http_ua_cpu" --> (none)
<!--#echo var="http_ua_os" --> (none)
<!--#echo var="http_ua_pixels" --> (none)
<!--#echo var="http_user_agent" --> CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
<!--#echo var="http_x_forwarded_for" --> (none)
<!--#echo var="instance_id" --> (none)
<!--#echo var="last_modified" --> Saturday, 24-Sep-2005 09:42:26 CDT
<!--#echo var="page_count" --> (none)
<!--#echo var="path" --> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
<!--#echo var="path_info" --> (none)
<!--#echo var="path_translated" --> (none)
<!--#echo var="query_string" -->
<!--#echo var="query_string_unescaped" --> (none)
<!--#echo var="remote_addr" --> 38.103.63.60
<!--#echo var="remote_host" --> (none)
<!--#echo var="remote_ident" --> (none)
<!--#echo var="remote_port" --> 41064
<!--#echo var="remote_user" --> (none)
<!--#echo var="request_method" --> GET
<!--#echo var="request_uri" --> /seminars/server_vars.shtml
<!--#echo var="script_filename" --> /home/httpd/html/theeggman/seminars/server_vars.shtml
<!--#echo var="script_name" --> /seminars/server_vars.shtml
<!--#echo var="script_uri" --> (none)
<!--#echo var="script_url" --> (none)
<!--#echo var="server_admin" --> [no address given]
<!--#echo var="server_addr" --> 69.93.41.134
<!--#echo var="server_name" --> www.smartalek.com
<!--#echo var="server_port" --> 80
<!--#echo var="server_protocol" --> HTTP/1.1
<!--#echo var="server_signature" -->
<!--#echo var="server_software" --> Apache/1.3.41 (Unix) PHP/5.2.8 mod_mono/1.1.13.5 mod_ssl/2.8.31 OpenSSL/0.9.7e FrontPage/5.0.2.2635
<!--#echo var="total_hits" --> (none)
<!--#echo var="tz" --> (none)
<!--#echo var="unique_id" --> (none)
<!--#echo var="user_name" --> theeggman
<!--#echo var="visp_domain" --> (none)
<!--#echo var="visp_remote_addr" --> (none)
<!--#echo var="visp_user" --> (none)

Top of the Page

Copyright © 1995-2005 by T. S. Eggleston