#!/usr/bin/perl
print "Content-type: text/html\n\n";
use CGI;
$query = new CGI;
$act = $query->param( 'act' );
if ( $act eq "Enter books" ) {
# Retrieve web argument values.
$title = $query->param( 'title' );
# Remove leading and trailing spaces.
$title =~ s/^\s*(\S*)\s*$/$1/;
# For security, remove some Unix metacharacters.
$title =~ s/;|>|>>|<|\*|\?|\&|\|//g;
$ISBN = $query->param( 'ISBN' );
$ISBN =~ s/^\s*(\S*)\s*$/$1/;
$ISBN =~ s/;|>|>>|<|\*|\?|\&|\|//g;
$price = $query->param( 'price' );
$price =~ s/^\s*(\S*)\s*$/$1/;
$price =~ s/;|>|>>|<|\*|\?|\&|\|//g;
$quantity = $query->param( 'quantity' );
$quantity =~ s/^\s*(\S*)\s*$/$1/;
$quantity =~ s/;|>|>>|<|\*|\?|\&|\|//g;
system( "./EnterBooks1 '$title' '$ISBN' '$price' '$quantity'" );
system( "/bin/cat EnterBooks1.html" );
}
elsif ( $act eq "Help" ) {
system( "/bin/cat Help.html" );
}
elsif ( $act eq "Home" ) {
system( "/bin/cat FPDemo.html" );
}
else {
print( "No such option: $act" );
}
|
|