I have written the following program that I access through another program. However, it give me the following error.
The server encountered an internal error or misconfiguration and was unable to complete your request.
#!/usr/bin/perl
print "Content-type:text/html\n\n";
use CGI;
$query = new CGI(param);
$d ="\$";
my $item1 = param("item");
my $price1 = param("price");
my $city1 = param("city");
$yes='no';
$p1='0';
open(INF, "<lawn.out") or dienice("Couldn't open auto.out for reading: $! \n");
@kites = <INF>;
close (INF);
foreach $i (@kites) {
chomp ($i);
($count,$name,$email,$address,$city,$state,$zipcode,$phone,$time,$pm,$item,$price,$body,$thismon,$mday,$year)=split(/\|/, $i);
if(lc($city1) eq lc($city)) {
if($price <= $price) {
if(lc($item) eq lc($item1)) {
print "<table width=\"100%\">\n";
print "<tr bgcolor=\"red\"><th>Item</th><th>Price</th><th>E-mail</th>\n";
print "<th>Telephone</th><th>Time-to-Call</th></tr>\n";
print "<td align=\"left\" width=\"25%\">$item</td><td align=\"left\" width=\"5%\"><font color=\"blue\"> $d$price </font></td>\n";
print "<td align=\"left\" width=\"20%\"><a href=\"mailto: $email\" >$email </a></td><td align=\"left\" width=\"15%\">$phone</td><td align=\"left\" width=\"15%\"> $time</td>\n";
print "<tr align=\"left\" valign=\"top\" bgcolor=\"#FF99FF\"> <td align=\"left\" colspan=\"7\" >$body</td>\n";
print "<td align=\"left\" colspan=\"2\"><font color=\"blue\">CODE#$phone $thismonth-$mday-$year</font></td></tr></table>\n";
}
}
}
}
# Wrap this code is an eval block in order to trap error
chomp $@;
if($@) { print "ERROR: $@<BR>\n"; }
print <<EndHTML;
sub dienice {
my($msg) = @_;
print "<h2>Error</h2>\n";
print $msg;
exit;
}
The server encountered an internal error or misconfiguration and was unable to complete your request.
#!/usr/bin/perl
print "Content-type:text/html\n\n";
use CGI;
$query = new CGI(param);
$d ="\$";
my $item1 = param("item");
my $price1 = param("price");
my $city1 = param("city");
$yes='no';
$p1='0';
open(INF, "<lawn.out") or dienice("Couldn't open auto.out for reading: $! \n");
@kites = <INF>;
close (INF);
foreach $i (@kites) {
chomp ($i);
($count,$name,$email,$address,$city,$state,$zipcode,$phone,$time,$pm,$item,$price,$body,$thismon,$mday,$year)=split(/\|/, $i);
if(lc($city1) eq lc($city)) {
if($price <= $price) {
if(lc($item) eq lc($item1)) {
print "<table width=\"100%\">\n";
print "<tr bgcolor=\"red\"><th>Item</th><th>Price</th><th>E-mail</th>\n";
print "<th>Telephone</th><th>Time-to-Call</th></tr>\n";
print "<td align=\"left\" width=\"25%\">$item</td><td align=\"left\" width=\"5%\"><font color=\"blue\"> $d$price </font></td>\n";
print "<td align=\"left\" width=\"20%\"><a href=\"mailto: $email\" >$email </a></td><td align=\"left\" width=\"15%\">$phone</td><td align=\"left\" width=\"15%\"> $time</td>\n";
print "<tr align=\"left\" valign=\"top\" bgcolor=\"#FF99FF\"> <td align=\"left\" colspan=\"7\" >$body</td>\n";
print "<td align=\"left\" colspan=\"2\"><font color=\"blue\">CODE#$phone $thismonth-$mday-$year</font></td></tr></table>\n";
}
}
}
}
# Wrap this code is an eval block in order to trap error
chomp $@;
if($@) { print "ERROR: $@<BR>\n"; }
print <<EndHTML;
sub dienice {
my($msg) = @_;
print "<h2>Error</h2>\n";
print $msg;
exit;
}