Information générale
Catégorie:
CGI/HTTP - Applications Internet
Titre:
Any Suggestions??? Appearently a bad script!
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement