While executing a perl script, it showed the following errors. Can anybody tell me what's wrong with the bottom script? Thanks a lot.
The server encountered an unexpected condition which prevented it from fulfilling the request.
The script did not produce correct headers. It must at least print out a Content-Type header, like so:
Content-Type: text/html
The header the script produced was:
HTTP/1.1 200 OK
And the script i used to print this out is:
#!/usr/bin/perl
use LWP 5.64;
use CGI qw(:standard -nph);
use strict;
use DBI;
my $ua = LWP::UserAgent->new(agent =>
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461)' ,
'cookie_jar' => {file => "./lwpcookies.txt", autosave => 1, ignore_discard => 1}
);
#$ua->timeout(10);
$| = 1;
my $verbose=0;
my $recip=0;
my $is_category_text;
my $random_number = rand();
my $c_file="count_".$random_number.".txt";
#open(FILE1,">$c_file");
#Database connection object
my $dbh = DBI->connect("dbi:mysql:db_hhh:localhost", "hhh", "123456",{RaiseError=>1, AutoCommit=>1, ShowErrorStatement=>1}) or print "failed to connect to database\n";
my $query = new CGI();
my %form;
print header();
print <<EOF;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="none">
<title>Cheap Submission to Thousands of Free Directories</title>
<link href="../substyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="820" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#F8F8E9">
<br />
<p class="outputtop" align="center"><b>Warning</b>: Depends on your internet connection, this process might take around one hour.<br>Please be patient and don't close the browser until the submission is completed.</p>
EOF