Article View: comp.lang.perl.misc
Article #246Re: AUTO-DETECT VISITORS' BROWSERS
From: Randal L. Schwartz
Date: Tue, 23 Jan 1996 00:00
Date: Tue, 23 Jan 1996 00:00
55 lines
2849 bytes
2849 bytes
>>>>> "Robert" == Robert Lavin <uctraing@uctraing.ultranet.com> writes:
>> Get a chance to talk with some of the greatest CGI experts on
>> the web as they teach you how to implement good CGI scripts
>> for your own site.
>> CGI is one of the most essential ingredients to creating a
>> trully interactive web site. Learn how to automatically
>> detect your visitor's web browsers and determine which page
>> you want to send them. This allows you to enhance your site
>> for the different web browsers.
>> The WebMasters Network.
>> http://TheWebMastersNetwork.Com
Robert> If you guys are so good:
Robert> Why, when I click on your page's image map, does your script return
Robert> an HTML file to me as text rather than as an HTML page ?
Robert> Why do you have spelling errors on your registration page:
Robert> begginer is spelled beginner
Robert> ^^^^^^^^
Robert> Why don't you list an email address on your pages ?
Robert> Why would anyone enter a credit card number and expiration date on your
Robert> form without any assurance that you're running encryption ?
And why would anyone *pay* to be able to learn to do this:
#!/usr/bin/perl
$browser = $ENV{HTTP_USER_AGENT};
if ($browser =~ /Mozilla/) {
$place = "netscape";
} elsif ($browser =~ /Lynx/) {
$place = "lynx";
} else {
$place = "other";
}
print "Location: http:/path/$browser/\n\n";
Really. It's not tough.
I'm not even *gonna* bring up what I think about writing non-HTML for
non-standard browsers like Netscape.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
# legal fund: $15186.84 collected, $134659.85 spent; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
Technical Details
Message-ID:
<uk20orm5t8.fsf@linda.teleport.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<4dpupa$abc@news.calweb.com> 15: 13:56 GMTShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1043e7,b41ca4735ac9b02d X-Google-Attributes: gid1043e7,public X-Google-Thread: fa0ae,b41ca4735ac9b02d X-Google-Attributes: gidfa0ae,public X-Google-Thread: f72c1,b41ca4735ac9b02d X-Google-Attributes: gidf72c1,public From: merlyn@stonehenge.com (Randal L. Schwartz) Subject: Re: AUTO-DETECT VISITORS' BROWSERS Date: 1996/01/23 Message-ID: <uk20orm5t8.fsf@linda.teleport.com> X-Deja-AN: 135996756 sender: merlyn@linda.teleport.com references: <4dpupa$abc@news.calweb.com> 15: 13:56 GMT organization: Stonehenge Consulting Services; Portland, Oregon, USA reply-to: merlyn@stonehenge.com newsgroups: comp.lang.perl.misc,fj.lang.perl,comp.lang.perl.tk