Closed Thread
Results 1 to 2 of 2

Thread: What's wrong with this perl error

  1. #1
    hhheng is offline Newbie
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

    What's wrong with this perl error

    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

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Nipa is offline Newbie
    Join Date
    Feb 2009
    Posts
    3
    Rep Power
    0

    Re: What's wrong with this perl error

    unexpected condition which prevented it from fulfilling the request.
    The script did not produce correct headers.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I'm Getting A Syntax Error; Anyone Know What's Wrong?
    By RhetoricalRuvim in forum C and C++
    Replies: 5
    Last Post: 06-28-2011, 01:28 AM
  2. Perl Mysql connection syntax code error
    By kevinsabres in forum Perl
    Replies: 6
    Last Post: 04-25-2010, 01:01 PM
  3. Package error (Not exist/Wrong name)
    By Cander in forum Java Help
    Replies: 2
    Last Post: 03-02-2010, 05:19 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts