The Perl code is below. Angel Fire lets me access the CGI server for
$5/month.
#!C:\Perl\bin\perl
#this code extracts the name after the question mark and then redirects the
browser to my site
$length=201;
print "Content-type:text/html\n\n";
#read input string sent by get method
$input =$ENV{'QUERY_STRING'};
#bring in the name
$name = $input;
#get rid of hex packing
$name =~ s/%(..)/pack("c",hex($1))/eg;
if(!$name)
{$name ="no_data";}
$score ="above";
# open the relational data file for input
..........................................................
open(RELDATA, "<reldata.txt");
flock(RELDATA, 2);
@array = <RELDATA>;
flock(RELDATA, 8);
close (RELDATA);
$temp = $array[0],
($count, $xname, $xscore, $xdate, $pages)=split(/,/, $temp, 5);
if($count eq "")
{$count ="0";}
$count = +$count+1;
$xname =~ s/%(..)/pack("c",hex($1))/eg;
# compose comma delimanated related data file
$date = localtime(time);
$pages = "see above";
$data = "$count".","."$name".","."$score".","."$date".","."$pages";
#unshift relational data file into array
unshift(@array, $data);
#determine the array length
$alength = @array;
if($alength > $length)
{pop(@array);}
#output the relational data------------------------------------------------
open(RESULT, ">reldata.txt");
flock(RESULT, 2);
foreach $array(@array)
{
$array =~ s/\n//g;
print RESULT $array;
print RESULT "\n";
}
flock(RESULT, 8);
close (RESULT);
#xml document code____________________________________________________
#open the xml file for
output..........................................................
open(XML, ">data.xml");
flock(XML, 2);
print XML "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
print XML "<Namefile>\n";
# xml output sequence...........................
for( $i=0; $i < ($alength-1); $i=$i+1 )
{
$packet = $array[$i];
($count, $xname, $xscore, $xdate, $xpages)=split(/,/, $packet, 5);
if($xpages eq "")
{$xpages ="no data";}
#security replace all control characters with an underbar
$xname =~ s/<(([^>]|\n)*)>/_/g;
$xscore =~ s/<(([^>]|\n)*)>/_/g;
$xdate =~ s/<(([^>]|\n)*)>/_/g;
$xpages =~ s/<(([^>]|\n)*)>/_/g;
# xml output sequence...........................
print XML "<cd>\n";
print XML "<visitor>";
print XML $count;
print XML "</visitor>\n";
print XML "<name>";
print XML "$xname";
print XML "</name>\n";
print XML "<score>";
print XML "$xscore";
print XML "</score>\n";
print XML "<date>";
print XML "$xdate";
print XML "</date>\n";
print XML "<pages>";
print XML "$xpages";
print XML "</pages>\n";
print XML "</cd>\n";
}
print XML "</Namefile>";
flock(XML, 8);
close (XML);
# REDIRECT TO TABLE HTML..................
print "<html>\n";
print "<script>\n";
print
"window.location.replace(\"_http://www.angelfire.com/scifi2/zpt/index.html\_
(http://www.angelfire.com/scifi2/zpt/index.html\) ")";
print "</script>\n";
print "</html>";
**************Start the year off right. Easy ways to stay in shape.
http://body.aol.com/fitness/winter-exercise?NCID=aolcmp00300000002489