Re: Collecting Browser strings

by "Peter Newton" <c-newton(at)ihug.co.nz>

 Date:  Tue, 4 Jan 2000 13:21:22 +1300
 To:  <hwg-techniques(at)hwg.org>
 References:  lodz
  todo: View Thread, Original
Hello Romek,

That is quite a puzzle.

Since I wrote both the html script and the cgi scripts I thought I'd show
how each accessed the info.

1st The html page
Here I used javascript as follows:-

<script language="javascript">
<!--
document.write(navigator.userAgent);
// -->
</script>

and with the cgi script I used:-

$browserstring = $ENV{'HTTP_USER_AGENT'};

As you can see I have NOT copied the string from the html page to the cgi
script via query string instead I obtained the info directly from the
environement variables.

I've done no filtering of data at either end, (exept the standard form data
extraction) I don't even check to see if the form has been filled out. I've
been informed by private email that the strings can be modified via proxy
servers (and we can see this on the list).  I don't know anything about this
but perhaps someone else might be able to put some light on it. Also it
appears that my host might be a virtual host this also might be something to
do with it.

Thanks
Peter Newton



>I'd like to report a little weird thing that happened when I went to add
>the WebTV viewer to the list.  On the main form page it listed the viewer
>properly as "Mozilla/3.0 WebTV/2.2 (Compatible; MSIE 2.0) but on the list
>it comes up as WebTV/1.2.  I don't know why that is.

  The string that browser left in my logs is:

    Mozilla/3.0 WebTV/1.2 (compatible; MSIE 2.0)

  Mind the difference  1.2 vs.  2.2

  And in logs from last month there is no version 2.2 of webTV

>
>HTH!
>
>St�phane Bergeron

--
Romek Zylla
~~~~~~~~~~~  after all the work done by Micro$oft (R)  ~~~~~~~~~~
        Personal Computer Science is an experimental one (C)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA