tester of echovar1.cgi

home  launcher  linkechovar 

The contents of HTTP_REFERER and hence the refering URL were:- 

Remote address
User agent is CCBot/2.0 (https://commoncrawl.org/faq/)
Referrer is
The script is https://onwardoverland.com/cgi-bin/echovar1.cgi
Referrer is
Remote name is
Remote IP is

$r = 100, $r0 = 0, $calling =

Length of $calling is

Here is the source listing of echovar1.cgi

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,$HTTP_referer, $newline, $remote_name, $length_of_remote_name, $addr, $remote_ip,
$r, $r0, $calling, $length_of_HTTP_referer, $length_of_calling
my $source = "echovar1.cgi";

sub whoareyou{
$newline = "<BR>\n";
print "Remote address $ENV{'REMOTE_ADDR'}$newline"; #
print "User agent is $ENV{'HTTP_USER_AGENT'}$newline"; # Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

print "Referrer is $ENV{'HTTP_REFERER'}$newline"; # http://www.onwardoverland.com/linkechovar.html
if (defined $ENV{'SCRIPT_URI'}){
print "The script is $ENV{'SCRIPT_URI'}$newline"; # false so no show

$HTTP_referer = $ENV{'HTTP_REFERER'};
if ($HTTP_referer =~ m|https?://([^/]*)/|i) {
$remote_name = $1;
$length_of_remote_name = length($remote_name);
if (($addr) = (gethostbyname($remote_name))[4]) {
$remote_ip = join(".",unpack("C4",$addr));
} else {
$remote_ip = "";
print "Referrer is $HTTP_referer", $newline; # http://www.onwardoverland.com/linkechovar.html
$length_of_HTTP_referer = length($HTTP_referer);
print "Remote name is $remote_name", $newline; # www.onwardoverland.com
print "Remote IP is $remote_ip", $newline; #

for($r=0; ($r<100)&&($r0<3); $r++ ){
if(substr($HTTP_referer,$r,1) eq "/"){$r0++};
} # $r -> 3rd forward slash

$calling = substr($HTTP_referer, $r, $length_of_HTTP_referer);

print "<BR><BR>\$r = $r, \$r0 = $r0, \$calling = $calling<BR><BR>"; # linkechovar.html

$length_of_calling = length($calling);

print "Length of \$calling is $length_of_calling<BR><BR>"; # 16

if ($calling eq "linkechovar.html"){print "\$calling = linkechovar.html<BR><BR>";}

}#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){
$store =~s/&/&amp;/g;
$store =~s/</&lt;/g;
$store =~s/>/&gt;/g;
print "$store $newline";

sub thankyou{
print "<HTML><HEAD><TITLE>tester of $source</TITLE></HEAD>
<H3>tester of echovar1.cgi</H3>
<A HREF=/index.html>home</A>&nbsp;
<A HREF=/launcher.html>launcher</A>&nbsp;
<A HREF=/linkechovar.html>linkechovar</A>&nbsp;
<P>The contents of HTTP_REFERER and hence the refering URL were:-&nbsp;<BR><BR>";

print "<H4>Here is the source listing of $source</H4><P>";

print "<FONT SIZE=2>
<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.
} # 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',
@months = ('January','February','March','April','May','June','July',
# 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 Friday, May 7, 2021 at 14:20:09. Page created on April 15th. 2008 and updated on February 28th. 2014.