Ergänzung - das cgi script
ERGÄNZUNG:
#! /usr/bin/perl
***********************************************************************
url_find.pl
URL database output script
copyright 1998 SPAK Dynamics
This script may be distributed freely
The content below the line labeled „#### SCRIPT CODE ####“ must NOT be changed!
***********************************************************************
#url database location
$dbase =’/var/www/html/site107/html/cgi-bin/url_base.txt’;
#send mail to this e-mail address
$mail_to=‚[email protected]‘;
#main page url or page url to return to
$return_url=‚http://www.psilinks.com‘;
#The title of your directories search engine; replace Psi-Links with the name you gave to your directory search engine
$title=‚Psi-Links‘;
#background color code of the page; default = soft yellow
$background_color="#6600FF";
SCRIPT CODE
The coding below must NOT be changed!
Error Output Message
sub error
{ print „Content-type: text/html\n\n“;
print „Input Error\n“;
print " Input Error \n";
print "
\n";
print „An error occured during the process; please use the back button, and try again.
\n“;
print "If the error persists, please inform the webmaster.
";
print „“;
exit;
}
Read the input from the form and place it into $form_info
read(STDIN, $form_info, $ENV{‚CONTENT_LENGTH‘});
Split the name-value pairs from the form and place them in the list „pairs“
@pairs = split(/&/, $form_info);
#split pair info into $name and $value array; clean up the control charactors
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(„C“, hex($1))/eg;
$FORM{$name} = $value;
}
#split keywords into the list keyword_list
@keyword_list=split(/ /,$FORM{‚key_it_in‘});
$form_index_1=$FORM{‚index_1‘};
$form_input_logic=$FORM{‚input_logic‘};
#get number of keywords
$number_keywords=@keyword_list;
print „Content-type: text/html\n\n“;
print „Search Output\n“;
print" $title Search Results „;
print“
Click here to return to the main page.
„;
unless (open (DATA_BASE,“$dbase")) {&error;}
@all_records = ;
close (DATA_BASE);
$total_records_found=0;
$zargformat=0;
for ($count_2=0; $count_2The Shareware Place
";
print "http://www.sharewareplace.com
";
print "Description: Our software library has all major category titles. Direct search and download.
„;
print“
„;
}
#Get individual records from array all_records
$total_lines=@all_records; #determine # of lines in the database
$count_record_line=0; #Start with record 0
while ($count_record_line „;
print““;
print"";
$total_records_found++;
$print_output=@record[2];
$sub_string=substr($print_output,10);
$print_output=@record[3];
$url_string=substr($print_output,9);
print "Site Name: $sub_string
";
$print_output=@record[3];
$sub_string=substr($print_output,9);
print "$sub_string
";
$print_output=@record[4];
$sub_string=substr($print_output,17);
print "Description: $sub_string
„;
print“
„;
} # END if ($record_found==1)
}# end while ($count_record_line10)
{print“
Click here to return to the main page.";}
print"";
print"";
print"";
print"";