eHow launches Android app: Get the best of eHow on the go.

How To

How to show basic visitor information using ASP

Member
By SB Glasby
User-Submitted Article
(0 Ratings)

Every web site owner wants to know more about their visitors to improve their site.

Using some simple ASP scripting, you can gather some basic information about your site visitors

Difficulty: Moderate
Instructions

Things You'll Need:

  • A Windows based sever running ASP or access to a windows based server running asp.
  • A basic text editor (notepad will do )
  • FTP software to upload your finished pages.
  1. Step 1

    Using your text editor program, create a new file and name it info.asp. Make sure to give the file the .asp extension so the server will know that the pages has server scripts to process.

    I will post all ASP Commands in the very last step so you can copy/paste the script into your page.

  2. Step 2

    Type this line:

    <%Response.Write(Request.ServerVariables("http_user_agent"))%>

    OR

    <%=Request.ServerVariables("http_user_agent")%>

    the <%= is equivalent to the Response.Write command


    It will show you basic information about the visitors browser.

  3. Step 3

    be sure to add line breaks or paragraph tags to separate you information:

  4. Step 4

    Type this line:

    <%Response.Write(Request.ServerVariables("remote_host"))%>

    OR

    <%=(Request.ServerVariables("remote_host")%>

    To show your visitors IP address.

  5. Step 5

    Type this line:

    <%=Request.ServerVariables("ALL_RAW")%>

    Will give you all the browser information about your visitor.

  6. Step 6

    Save the file

  7. Step 7

    Upload this file to your web server

  8. Step 8

    call this file in your web browser as:

    http://yoursitename.com/info.asp

  9. Step 9

    See all the information that you can gather using this script.

  10. Step 10

    All commands:

    <%=Request.ServerVariables("http_user_agent")%>
    <%= Request.ServerVariables("remote_addr")%>
    <%= Request.ServerVariables("ALL_RAW")%>

Tips & Warnings
  • If you write this information to a database instead of the browser, it can become very useful.
  • You do not need to use standard tagging information for the browser to display this as ASP is process on the server, and you and or your visitors only see the output of the script after it has run.
  • This will only run on Windows Servers that have ASP installed and configured on it.
  • This may not work on an Apache Server running Chillisoft ASP.

Post a Comment

Post a Comment
  • Have you done this? Click here to let us know.
I Did This

Related Ads

Tags
Internet
Virginia DeBolt,

Meet Virginia DeBolt eHow's Internet Expert.

Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

Demand Media
eHow_eHow Technology and Electronics