#!/usr/bin/perl
print "Content-type: text/html\n\n";
use CGI;
$query = new CGI;
# Retrieve web argument values.
$act = $query->param( 'act' );
print <<EndofHTML;
<html>
<body>
EndofHTML
if ( $act eq "List the titles" ) {
$name = $query->param( 'name' );
# Remove leading and trailing spacing.
$name =~ s/^\s*(\S*)\s*$/$1/;
# For security, remove some Unix metacharacters.
$name =~ s/;|>|>>|<|\*|\?|\&|\|//g;
system ( "/usr/bin/java ListTitles '$name'" );
}
elsif ( $act eq "Help" ) {
system( "/bin/cat Help.html" );
}
else {
print( "No such option: <em>$act</em>" );
}
print <<EndofHTML;
</body>
</html>
EndofHTML
|