#!/usr/bin/perl ################################################################# # Title : User Identification CGI # Author : Walter Moore aperson@aperson.com # Created : 2/07/97 # Version : 1.0 # Comments : This CGI determines the users system, then displays # : the detected information to them. It can alternately # : link to HTML pages to provide more information for # : both Netscape and Microsoft browsers. # : Copyright,1997 Aperson.Com. ################################################################ # Deal with Ian, the little twerp ################################################################ $sendhim = '/yourtoast.htm'; if ($ENV{'REMOTE_HOST'} eq "irp.interlog.com"){ print "Location: $sendhim\n\n"; } ################### # Define Variables and set to default values. Do not change these ################### $browser = "$ENV{'HTTP_USER_AGENT'}"; # Browser name, version, OS. $realos = "XX"; # the Operating System(OS) can be 31,95,NT,MA,OS,XX $realbrowser = "XX"; # the browser name can be IE or NN $realver = "1"; # the browser single digit version. $realsubver = "00"; # default two digit subversion $thesheet = "/r.cgi?F=basestyle"; # the style sheet $thebackground = "/r.cgi?P=background"; # background image $thebgcolor = "#FFFFFF"; # background color $thelink = "#4f4fff"; # link color $thevlink = "#6f6f7f"; # visited link color $justme = 'aperson@aperson.com'; # my email address $nnframes = "2"; # Netscape number of frames $ieframes = "2"; # Ie number of frames $overlink = "#2fbf2f"; # default mouse over link color. $lastlink = "#ff2f2f"; # default last link color. $defhelp = "Functional help has been here since Netscape 2.0beta1"; # default statusbar help ################## # Start real work. # Detect browser, version and subversion. ################## if ($browser =~ /MSIE/) { # They are using microsoft browser $realbrowser = "IE"; $maxframes = $ieframes; } else { $realbrowser = "NN"; # default to netscape browser $maxframes = $nnframes; } $realver = substr($browser,$[+8,1); $realsubver = substr($browser,$[+10,2); ################## # Detect operating system ################## if ($browser =~ /Windows 3/ | $browser =~ /Win3/) {$realos = "31"} # They are using windows 3* if ($browser =~ /Windows 95/ | $browser =~ /Win95/) {$realos = "95"} # They are using windows 95 if ($browser =~ /Windows NT/ | $browser =~ /WinNT/) {$realos = "NT"} # They are using windows NT if ($browser =~ /OS/ | $browser =~ /Os/) {$realos = "OS"} # They are using OS/2 if ($browser =~ /Mac/ | $browser =~ /MAC/) {$realos = "MA"} # They are using OS/2 ################## # Completed detection. Now write out results in form. # first print out header information ################## print "Content-type: text/html\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print " \n"; ################## # next section only written if browser supports scripting ################## if ($realver >= 2){ print "\n"; print "\n"; print "\n"; } print "\n"; print "\n"; ################## # next section written if browser supports scripting. otherwise prints big logo(no frames then) ################## if ($realver >= 2){ print "\n"; print "\n"; } else { print "
\"Aperson.Com

\n"; } print "\n";