test of echovar2.cgi

home  launcher  linkechovar 

Here is the source listing of echovar2.cgi

#!/usr/bin/perlml
use strict;
use CGI qw(:standard);
print header; # print "Content-type: text/html\n\n";
$| = 1;
open (STDERR, ">&STDOUT");
use CGI::Carp qw(fatalsToBrowser);
my $date;
my $HTTP_referer = $ENV{'HTTP_REFERER'}; # http://cp.onwardoverland.com/linkechovar1.html
my $newline = "<BR>\n";
my $on = "onwardoverland.com/";
my $source = "echovar2.cgi";
&get_date;
&thankyou;

sub whoareyou{
my $calling = substr($HTTP_referer, index($HTTP_referer, $on )+length($on), length($HTTP_referer));
if ($calling eq "linkechovar.html"){print "\$calling eq linkechovar.html $newline";}
}#end of whoareyou

sub disp{
my $store;
open(SOURCE, $source) or die ("5 Can't open $source: $!");
my @lines = <SOURCE>;
close(SOURCE) or die ("6 Can't close $source: $!");
foreach $store (@lines){
chop($store);
$store =~s/&/&amp;/g;
$store =~s/</&lt;/g;
$store =~s/>/&gt;/g;
print "$store $newline";
}
}


sub thankyou{
print "<HTML><HEAD><TITLE>test of echovar2.cgi</TITLE></HEAD>
<BODY bgcolor=#CCCCCC><FONT FACE=ARIAL SIZE=3>
<H3>test of $source</H3>
<A HREF=/index.html>home</A>&nbsp;
<A HREF=/launcher.html>launcher</A>&nbsp;
<A HREF=/linkechovar.html>linkechovar</A>&nbsp;

<P>";
&whoareyou;
print "<H4>Here is the source listing of $source</H4><P>";
&disp;
print "<BR><FONT SIZE=3>
<A HREF=/index.html>home</A>&nbsp;
<A HREF=/launcher.html>launcher</A>&nbsp;
<A HREF=/linkechovar.html>linkechovar</A>&nbsp;

Test run on $date. Page created on April 15th. 2008 and updated on February 28th. 2014.
<BR><BR>
</BODY></HTML>";
} # end of sub thankyou

sub get_date {
my (@days, @months, $sec, $min, $hour, $mday, $mon, $year, $wday, $time);
# Define arrays for the day of the week and month of the year. #
@days = ('Sunday','Monday','Tuesday','Wednesday',
'Thursday','Friday','Saturday');
@months = ('January','February','March','April','May','June','July',
'August','September','October','November','December');
# Get the current time and format the hour, minutes and seconds. Add #
# 1900 to the year to get the full 4 digit year. #
($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6];
$time = sprintf("%02d:%02d:%02d",$hour,$min,$sec);
$year += 1900;
# Format the date. #
$date = "$days[$wday], $months[$mon] $mday, $year at $time";
} # end of sub get_date




home  launcher  linkechovar  Test run on Thursday, March 28, 2024 at 17:19:16. Page created on April 15th. 2008 and updated on February 28th. 2014.