[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] The much overused browser detection! DEBUG PLZ!



The first two options work.  I get a server execution error on the third.  Why?
(*The error occurred with MSIE v3.02 on Win95*)
ps.  the document DOES exist in the third IF statement.


#!/usr/bin/perl
#which_browser.pl
#script redirects user to specified page dependant upon browser that is
detected.

#detects Netscape
if (($ENV{HTTP_USER_AGENT} =~ /Mozilla/i) && (!($ENV{HTTP_USER_AGENT} =~
/MSIE/i)))
	{ print "Location:http://www.jann.com/setup95nn.htm\n\n";}

#Detects ANY mac browser
if (($ENV{HTTP_USER_AGENT} =~ /PPC/i) || ($ENV{HTTP_USER_AGENT} =~
/Mac_68000/i))
	{ print "Location:http://www.jann.com/setup95nn.htm\n\n";}

#Detects ANYTHING else
if (!($ENV{HTTP_USER_AGENT} =~ /PPC/i) && (!($ENV{HTTP_USER_AGENT} =~
/Mac_68000/i)) && (!($ENV{HTTP_USER_AGENT} =~ /Mozilla/i)))
	{print "Location:http://www.jann.com/activex.shtml\n\n";}

#Logic is incorrect, Anything else shouldn't go to an activex enabled page,
but just for the sake of argument...ya' know.


**
professional site:  http://www.jann.com/
personal site:       http://www.jann.com/jann/
email:                  mailto:webmaster@jann.com
**
Funniest definition I've ever heard:
Windows 95: n. 32 bit extensions and a graphical shell for a 16 bit patch
to an 8 bit operating system originally coded for a 4 bit microprocessor,
written by a 2 bit company.



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch