Answers Search Help
Boston University home page
Forms: Introduction
 
 
 
 
    HTML Elements
 
 
 
 
 
 
 
    PonyExpress
 
 
 
 
    Form to E-mail
 
 
 
 
    Form to Datafile
 
 
 
 
    Form to Web Page
 
 
 
 
    Also See
   
 

Environment variables

In certain cases you may want to capture other information about visitors -- their IP addresses or the browsers they are using, for instance. To do this you can take advantage of environment variables which are passed from the visitor's browser to PonyExpress. Any hidden variables you create whose names begin with a dollar sign ($) will be replaced in the output with the environment variable of the same name. The most common cases:

<input type="hidden" name="$REMOTE_ADDR">

This appears in the output as the IP address of the machine making the request. Note that this is often not the end user's machine, but a proxy server forwarding their requests.

EXAMPLE: " 38.107.191.87 "

 

<input type="hidden" name="$HTTP_USER_AGENT">

This appears as a string identifying the user's browser. Note that the vast majority of browsers out there (including IE) identify themselves as Mozilla/X.x ...

EXAMPLE:" CCBot/1.0 (+http://www.commoncrawl.org/bot.html) "

 

WebCentral Using Publishing Learning Training Consulting WebCentral
Answers Search Help
NIS  |  OIT  |  Boston University  |   January 9, 2007