#!/usr/bin/perl -w use CGI; use CGI ":standard"; $time = localtime; $servertime = `uptime`; print header, start_html(-title=>"SysInfo", -background=>"tower.jpg", -text=>"black"), h1({-align=>center}, "Franklin University's System Information", b), start_form, radio_group( -name=>'base', -values=>['Up Time','Server Time'], -default=>'Up Time'), p, submit, end_form, hr; print CGI::center(); $base = param("base"); if ($base eq "Up Time") { printf($servertime); } else { printf($time); } print hr; print CGI::center(); $log = "count.dat"; open GETCOUNT, "<$log" or die("Error in $0: $log - $!n"); $hits = ; close(GETCOUNT); $hits++; printf "This web page has been viewed $hits times."; open COUNT, ">$log" or dienice("Cant open file to WRITE"); print COUNT $hits; close COUNT; print hr; use strict; print start_html("Browser Detect"); my($ua) = $ENV{HTTP_USER_AGENT}; if (index($ua, "MSIE") > -1) { print "The Franklin Server has determined that you are using Internet Explorer to access it.

\n"; } elsif (index($ua, "Netscape") > -1) { print "The Franklin Server has determined that you are using Netscape to access it.

\n"; } elsif (index($ua, "Safari") > -1) { print "The Franklin Server has determined that you are using Safari to access it.

\n"; } elsif (index($ua, "Opera") > -1) { print "The Franklin Server has determined that you are using Opera to access it.

\n"; } elsif (index($ua, "Mozilla") > -1) { print "The Franklin Server has determined that you are probably using Mozilla to access it.

\n"; } else { print "The Franklin Server cannot tell what browser you are using!

\n"; } print end_html;