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

[MacPerl] Browser Redirect Script (Thanks)



To all of you who sent in help for a browser redirect script - Thanks. 
Though I will continue to tinker this is what I have come up with if anyone
is interested.  It will print out a message directing your viewer to the
most recent browsers based upon their OS.

P.S: I have been having a heck of a time getting these to execute on an NT
Server (the administrator has to set permissions even though it appears to
be rwxr-xr-x(755)) from my end.  Anyway I would love to move my site to a
Mac Shop.
Does anyone know of a place that can come close to this on a Mac Server:
100 Megs storage
3 GB Month Traffic
Anonymous FTP
Full CGI Bin Access
$20/month.

#!/usr/local/bin/perl
#
#########################################################################
# Script to redirect to most current web browser download based upon OS #
# Kevin Diffily  kdiffily@webpageweaver.com   www.webpageweaver.com     #
# Copyright 1998 Kevin Diffily                                          #
# 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.                           #
#########################################################################


$^O =~ /Win/ and $netlocation =
'ftp://ftp.netscape.com/pub/communicator/4.5/english/windows/windows95_or_nt/com
plete_install/cc32e45.exe';
$^O =~ /Win/ and $explocation =
'http://www.microsoft.com/windows/ie/download/default.asp';
$^O =~ /Win/ and $os = 'Windows';

$^O =~ /Mac/ and $netlocation =
'ftp://ftp.netscape.com/pub/communicator/4.5/english/mac/complete_install/Comm4.
5_Complete_EX.bin';
$^O =~ /Mac/ and $explocation =
'http://www.microsoft.com/windows/ie/download/mac.htm';
$^O =~ /Mac/ and $os = 'Macintosh';

$^O =~ /Unix/ and $netlocation =
'ftp://ftp.netscape.com/pub/communicator/4.5/english/unix/supported/';
$^O =~ /Unix/ and $explocation =
'http://www.microsoft.com/msdownload/iebuild/ie4_unix/en/ie4_unix.htm';
$^O =~ /Unix/ and $os = 'Unix';

$location ||= 'unix/index.html';
print<<html_page;
<html>

	<head>
		<meta http-equiv="content-type"
content="text/html;charset=iso-8859-1">
		<meta name="generator" content="GoLive CyberStudio 3">
		<title>Up to Date Browser Redirection</title>
	</head>

	<body bgcolor="white">
		<center>
			<font size="4"><b>This site utilizes advanced
features such as JavaScript, Dynamic HTML, Cascading Style Sheets, and
Java. </b></font>
			<p><font size="4"><b>Your current browser does not
support these features. </b></font></p>
			<p><font size="4"><b>You can find a current $os
browser at one of the following links: </b></font></p>
			<p><a href="$netlocation" target="_self"
title="Netscape Communicator Downlaod"><font size="5">Netscape
Communicator</font></a></p>
			<p><a href="$explocation" target="_self"
title="Microsoft Internet Explorer Download"><font size="5">Microsoft
Internet Explorer</font></a></p>
			<p>&nbsp;</center>
	</body>

</html>


html_page

__END__

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