Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any Suggestions??? Appearently a bad script!
Message
De
22/07/2002 11:20:29
 
 
À
Tous
Information générale
Forum:
Perl
Catégorie:
CGI/HTTP - Applications Internet
Titre:
Any Suggestions??? Appearently a bad script!
Divers
Thread ID:
00681164
Message ID:
00681164
Vues:
51
Hello all again ;
I am trying to write a cgi script that will be running under perl 5, but I am having a hard time getting the syntax right appearently. What this script is supposed to do is open a text file which contains ranges of control numbers, and the redirected http addresses. This script is supposed to take the control number which is coming from another form(http)and search the text file to get the correct redirect http address. When I run it, I dont get errors.. but just gives me the 404 error(page not found). Please look at my .Cgi script below:

#!/usr/bin/perl

$datafile = "httpdata.txt";
$control = $FORM{'CONTROL'} ;
print "Set-Cookie: CONTROL=$FORM{'CONTROL'}\n";
$searchstr = $control;
open(INF,$datafile);
@mydata = ;
close(INF);
print "This is working\n\n" ;
print "Content-type:text/html\n\n";
@results = grep(/$searchstr/i,@mydata);
if ($#results > 0) {
foreach $i (@results)
{
chomp($i);
($reference,$start,$end,$addr) = split(/; /,$i);
if ($start<= $control and $end>= $control)
{
print "location: $addr\n";
}
}
}
else
{
print "No results found\n" ;
}
print "location: $addr\n\n";


Any Ideas?
PLEASE HELP!!!!

Thanks
Rick
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform