|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/mandarintools/cgi-bin/ |
Upload File : |
#!/usr/bin/perl
require "cgi-lib.pl";
$termfile = "church-terms.txt";
&ReadParse(*values);
print "Content-type: text/html; charset=big5\n\n";
print "<HTML>\n<HEAD>\n";
print "<TITLE>Chinese LDS Term Search Result</TITLE>\n<HEAD>\n";
print "<BODY>\n<H1>Search Result</H1>\n";
print "<P>";
&TermSearch;
print "<P><I><FONT SIZE=-1>Chinese on this web page is encoded using Big5.</FONT></I>";
print "<P>";
print '<H2>Do another search:</H2>';
print "<P>";
print '<FORM ACTION="http://cgibin.erols.com/eepeter/cgi-bin/church-terms.pl" METHOD="POST">';
print "Please enter the English LDS term you wish to look up in Chinese:<BR>";
print 'Term: <INPUT TYPE="text" name="estring"><BR>';
print '<INPUT TYPE="submit" value="Do Search">';
print '<INPUT TYPE="reset" value="Clear Entry">';
print '<P>';
print "The search is not case sensitive.";
print "</FORM>";
print "</BODY>\n</HTML>\n";
exit 0;
sub TermSearch {
open(TFILE, $termfile) || print "Can't open the file.<BR>\n";
my($found) = 0;
my(@terms);
print "<TABLE cellpadding=5>\n<TR bgcolor=lightblue>\n<TD><STRONG>English</STRONG></TD><TD><STRONG>Chinese</STRONG></TD>\n</TR>\n";
while (<TFILE>) {
@terms = split(/\t\t/);
if ($terms[0] =~ m/$values{'estring'}/i) {
if ($found % 2 == 0) {
print "<TR bgcolor=skyblue>";
} else {
print "<TR bgcolor=lightblue>";
}
print "<TD>$terms[0]</TD><TD>$terms[1]</TD></TR>\n";
$found++;
}
}
print "</TABLE>";
print "Sorry, the term \"$values{'estring'}\" is not currently in the database.\n" if $found == 0;
close TFILE;
}