#!/usr/local/bin/perl # ######################################################################### # Script to get different pages depending upon the client's web browser # # Drea Leed aleed@dnaco.net # # Copyright 1996 Drea Leed # # Unpublished work # # # # Permission granted to use and modify this script so long as the # # copyright above is maintained and modifications are documented. # # credit is given for any use of the library. # ######################################################################### ##absolute path to the page to be displayed if the browser is Netscape 2.0: $page1="/home2/aleed/public_html/cgi-bin/browse/netscape2.html"; ##absolute path to the page to be displayed if the browser is Netscape 1.1: $page2="/home2/aleed/public_html/cgi-bin/browse/netscape1.html"; ##absolute path to the page to be displayed if the browser is Netscape 1.0: $page3="/home2/aleed/public_html/cgi-bin/browse/netscape0.html"; ##absolute path to the page to be displayed if the browser is Lynx: $page4="/home2/aleed/public_html/cgi-bin/browse/lynx.html"; ##absolute path to the page to be displayed if browser is Microsoft Explorer: $page5="/home2/aleed/public_html/cgi-bin/browse/microsoft.html"; ##absolute path to the page to be displayed if the browser is NCSA Mosaic: $page6="/home2/aleed/public_html/cgi-bin/browse/mosaic.html"; ##absolute path to the page to be displayed if the browser is AOL's browser: $page7="/home2/aleed/public_html/cgi-bin/browse/aol.html"; ##absolute path to the page to be displayed if the browser is hotjava: $page8="/home2/aleed/public_html/cgi-bin/browse/java.html"; ##absolute path to the page to be displayed if the browser is MacWeb: $page9="/home2/aleed/public_html/cgi-bin/browse/macweb.html"; ##absolute path to the page to be displayed if the browser is IBM WebExplorer: $page10="/home2/aleed/public_html/cgi-bin/browse/IBM.html"; ##absolute path to the page to be displayed for any other browser: $page="/home2/aleed/public_html/cgi-bin/browse/other.html"; #You shouldn't need to change anything beneath this line #_________________________________________________________________ ($TYPE = $ENV{'HTTP_USER_AGENT'}); $page=$page1 if $TYPE =~ /Mozilla\/2.0/; $page=$page2 if $TYPE =~ /Mozilla\/1.1/; $page=$page3 if $TYPE =~ /Mozilla\/1.0/; $page=$page4 if $TYPE =~ /Lynx/i; $page=$page5 if $TYPE =~ /microsoft/i; $page=$page6 if $TYPE =~ /mosaic/; $page=$page7 if $TYPE =~ /aol/i; $page=$page8 if $TYPE =~ /java/i; $page=$page9 if $TYPE =~ /MacWeb/i; $page=$page10 if $TYPE =~ /WebExplorer/i; print "Content-type: text/html\n\n"; open (PAGE, "$page") || die "Couldn't open $page"; while () {print;}