home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet 1996 World Exposition
/
park.org.s3.amazonaws.com.7z
/
park.org.s3.amazonaws.com
/
Pavilions
/
BrainOpera
/
cgi-bin
/
text
/
browser.cgi
< prev
next >
Wrap
Text File
|
2017-09-21
|
919b
|
36 lines
#!/usr/local/bin/perl
# This script written by Ben Adida (benjamin@media.mit.edu)
# Finds out which browser, if not compatible, redirects to a no-netscape page.
$LOGFILE="/users/benjamin/LOGS/visitors";
$BAD_LOGFILE="/users/benjamin/LOGS/bad-visitors";
$CGI_DIR="/web-cgi-bin";
do "$CGI_DIR/referer.pl";
do "$CGI_DIR/user-agent.pl";
do "$CGI_DIR/redirect.pl";
$USER_AGENT=&get_user_agent();
&get_referer();
&get_remote_host();
chop($date= `date +%x%t%X`);
if (grep(/Mozilla\/2.0/,"$USER_AGENT")) {
&redirect("http://brainop.media.mit.edu/first-page.html");
open(logfile,">> $LOGFILE");
print logfile "$date\t\t$REMOTE_HOST\n $REFERER\t $USER_AGENT\n\n";
close(logfile);
} else {
&redirect("http://brainop.media.mit.edu/no-netscape/index.html");
open(bad_logfile,">> $BAD_LOGFILE");
print bad_logfile "$date\t\t$REMOTE_HOST\n $REFERER\t $USER_AGENT\n\n";
close(bad_logfile);
}