æåø i script???
Jeg har fundet et søge script som opfylder de ting det skal. Men jeg kan ikke få det til at søge efter danske bogstaver som åæø fx. Århus, kan man få det til det???Her er scriptet:
#!/usr/local/bin/perl
# what does the user want to find?
($dump,$search) = split(/=/,$ENV{'QUERY_STRING'});
# let's not make the search case-sensitive, ok?
$ucsearch = uc($search);
$the_file = "./search.txt";
$started_table = "no";
print "Content-type: text/html\n\n";
print "<HTML><BODY>";
print "<TITLE>Search Results</TITLE>";
if ($search ne "")
{
print "<FONT SIZE=+4>Search Results for $search</FONT><HR>";
if (open(THE_FILE, "$the_file"))
{
# begin the table
while (<THE_FILE>)
{
$record = $_;
$_ = uc($_);
if (/$ucsearch/)
{
if ($started_table eq "no")
{
$started_table = "yes";
print "<TABLE BORDER=1 WIDTH=100% BGCOLOR=\"#FFFFFF\">";
}
# begin one table row
print "<TR>";
@fields = split(/\t/,$record);
foreach $field (@fields)
{
# display one data cell for the table row
print "<TD VALIGN=TOP>$field</TD>";
}
# end of one table row
print "</TR>";
}
}
close(THE_FILE);
# end of the table
if ($started_table eq "yes")
{
print "</TABLE>";
}
else
{
print "what you were looking for could not be found.\n";
}
print "<P>";
}
else
{
print "unable to open the file $the_file.\n";
}
}
else
{
print "<FONT SIZE=+4>No query string given</FONT>";
}
print "</BODY></HTML>";
T2C
