none of the ahref statements in this coe r working. could anyone please tell me what the problem is. the file that the link must point to ..exists. thx in advance. its urgent.
#!/usr/bin/perl
%in= &getcgivars ;
print "Content-type: text/html\n\n" ;
print <<EOF ;
<html>
<head><title>SCAN CHOICES</title></head>
<body>
<h1>CHOICES MADE ARE</h1>
<ul>
EOF
foreach $key (keys %in) {
if($in{$key} ne " "

{
if($key eq "SCANTYPE3" || $key eq "SCANTYPE4" || $key eq "SCANTYPE5"

{
print "SCANTYPE = $in{$key}";
}
else
{
print "<li>$key = $in{$key}\n" ;
}
}
}
if ($in{SCANTYPE} ne " "

{
if($in{SCANTYPE3} ne " " || $in{SCANTYPE4} ne " " || $in{SCANTYPE5} ne " "

{
print "<p><B>ERROR: </B>Enter a single scan type";
}
else
{
if(!$in{IP})
{
print "<p><B>No IP address has been entered : </B>";
print "Scan will be performed on localhost";
$in{IP}= `localhost`;
}
if(-e "/home/samantha/apache_1.3.17/htdocs/$in{IP}/NMAP/$in{SCANTYPE}.txt"

{
print "<p><B>This scan has already been performed on $in{IP}</B>";
print "<p><B>To continue click<B>";
print a({-href=> "sam1.cgi?IP=$in{IP}&SCANTYPE=$in{SCANTYPE}"},"CONTINUE"

;
print "<p><B>To view the results click </B>";
print a({-href=> "../$in{IP}/NMAP/$in{SCANTYPE}.txt"}," RESULTS"

;
}
else
{
print "<p><B>Wait for the scan to complete</B>";
if(-e "/home/samantha/apache_1.3.17/htdocs/$in{IP}/NMAP"

{
chdir "/home/samantha/apache_1.3.17/htdocs/$in{IP}/NMAP";
}
elsif(-e "/home/samantha/apache_1.3.17/htdocs/$in{IP}"

{
chdir "/home/samantha/apache_1.3.17/htdocs/$in{IP}";
mkdir "NMAP";
chdir "/home/samantha/apache_1.3.17/htdocs/$in{IP}/NMAP";
}
else
{
chdir "/home/samantha/apache_1.3.17/htdocs";
mkdir "$in{IP}";
chdir "/home/samantha/apache_1.3.17/htdocs/$in{IP}";
mkdir "NMAP";
chdir "/home/samantha/apache_1.3.17/htdocs/$in{IP}/NMAP";
}
if($in{SCANTYPE} eq "FastScan"

{
`nmap -F $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
if($in{SCANTYPE} eq "PortScan"

{
`nmap -sT $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
if($in{SCANTYPE} eq "SYNScan"

{
`nmap -sS $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
if($in{SCANTYPE} eq "PingScan"

{
`nmap -sP $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
if($in{SCANTYPE} eq "UDPScan"

{
`nmap -sU $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
if($in{SCANTYPE} eq "RPCScan"

{
`nmap -sR $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
if($in{SCANTYPE} eq "NetworkScan"

{
`nmap -PT $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
if($in{SCANTYPE} eq "SubnetScan"

{
}
if($in{SCANTYPE} eq "rhostScan"

{
`nmap -O $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
if($in{SCANTYPE} eq "ridentScan"

{
`nmap -I $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
if($in{SCANTYPE} eq "ACKScan"

{
`nmap -sA $in{IP} -oN ./$in{SCANTYPE}.txt`;
}
print "<p></B>To view the results click</B>";
print a({-href=> "../$in{IP}/NMAP/$in{SCANTYPE}.txt"},"RESULTS"

;
}
}
}
print <<EOF ;
</ul>
</body>
</html>
EOF
exit ;
sub getcgivars {
local($in, %in) ;
local($name, $value) ;
# First, read entire string of CGI vars into $in
if ( ($ENV{'REQUEST_METHOD'} eq 'GET') ||
($ENV{'REQUEST_METHOD'} eq 'HEAD') ) {
$in= $ENV{'QUERY_STRING'} ;
} elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
if ($ENV{'CONTENT_TYPE'}=~ m#^application/x-
{
$ENV{'CONTENT_LENGTH'}
|| &HTMLdie("No Content-Length sent with the POST request."

;
read(STDIN, $in, $ENV{'CONTENT_LENGTH'}) ;
} else {
&HTMLdie("Unsupported Content-Type: $ENV{'CONTENT_TYPE'}"

;
}
} else {
&HTMLdie("Script was called with unsupported REQUEST_METHOD."

;
}
# Resolve and unencode name/value pairs into %in
foreach (split('&', $in)) {
s/\+/ /g ;
($name, $value)= split('=', $_, 2) ;
$name=~ s/%(..)/chr(hex($1))/ge ;
$value=~ s/%(..)/chr(hex($1))/ge ;
$in{$name}.= "\0" if defined($in{$name}) ; # concatenate multiple vars
$in{$name}.= $value ;
}
return %in ;
# Die, outputting HTML error page
# If no $title, use a default title
sub HTMLdie {
local($msg,$title)= @_ ;
$title || ($title= "CGI Error"

;
print <<EOF ;
Content-type: text/html
<html>
<head>
<title>$title</title>
</head>
<body>
<h1>$title</h1>
<h3>$msg</h3>
</body>
</html>
EOF
exit ;
}
regards
samantha