frmhello2.asp
Page source
interaction with client information -- response
Hello Larry, my friend. I see you are at 127.0.0.1, and you are using the Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4Web client.
Script listing
interaction with client information -- response
<%
dim strName 'name typed on the form
dim strIPAdd 'client’s IP address
dim strBrowser 'client browser name
strName = request.form ("txtName")
strIPAdd = request.servervariables ("remote_addr")
strBrowser = request.servervariables ("http_user_agent")
response.write ("Hello " & strName & ", my friend. I see you are at " & strIPAdd & ", and you are using the " & strBrowser & "Web client.")
%>
Explanation
This script is called by frmhello2.htm. It uses the form method of the request object to read the name the user entered in the form.
When the user submits the form, certain header information is automatically sent to the server. This automatically included information is retrieved using the servervariables method of the request object.
In this example, we are retrieving the client IP address and browser identification.
The name, IP address and browser characteristics are included in the output page using the write method of the response object.