Rev cgi way to GET browser info

SparkOut SparkOutYNY at
Mon Mar 2 19:42:29 EST 2009

$HTTP_USER_AGENT will return the browser reference string, but you may well
have to parse it quite substantially to extract the actual distinct version
of a given browser.

For instance, on my XP machine, Internet Explorer 7 reports: Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR
2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)

from which you can determine the MSIE 7.0 part quite readily. Some browsers
do not report the information as unambigously, although I think these days
most are pretty sensible.
On the same system Opera reports: Opera/9.62 (Windows NT 5.1; U; en-GB)
Firefox gives: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:
Gecko/2009011913 Firefox/3.0.6


Nicolas Cueto-4 wrote:
> Hello List,
> Wish I knew the terminology that'd make clearer this question...
> What command (global?) do I work with in a Rev cgi script
> when I want to retrieve information about the browser (user agent?)
> during a GET command?
> I have managed to retrieve server-related globals using this
> script:
>   #!TheRevEngine
>   on startup
>     repeat for each item i in the globals
>      put i && "=" && value(i) & return after buffer
>     end repeat
>     read from stdin until empty
>     put it after buffer
>     put "Content-Type: text/plain" & cr
>     put "Content-Length:" && the length of buffer & cr & cr
>     put buffer
> end startup
> However, nowhere in that returned data is there information
> about the user's browser.
> (The reason I'm after this is that, to individualize the look of
> my webpages for cell-phone users here in Japan, I first need
> to know what phone-provider a person is using when visiting
> one of my web-urls. From PHP guides on this topic, it seems
> that this information is passed invisibly between the cell-phone's
> browser and the web-server.)
> Hope that was clear.
> Thanks.
> _______________________________________________
> use-revolution mailing list
> use-revolution at
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:

View this message in context:
Sent from the Revolution - User mailing list archive at

More information about the Use-livecode mailing list