Why Doesn't This CGI Piece Work?

Discussion in 'HTML' started by vertigo, Jun 28, 2003.

  1. vertigo

    vertigo Guest

    I need to display the text banner inside the sub "credit" below.
    I want to call the CGI file, test.cgi, from inside an HTML file.
    I need this text banner displayed exactly where I call it in the
    HTML file.
    What else is need here? I get the error:

    Premature end of script headers

    Thanks!

    vertigo

    test.cgi file below:

    #!/usr/bin/perl
    #############################################
    #############################################
    ($sec,$min,$hr,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
    &credit;
    exit;

    sub credit {
    print "Content-type: text/html\n\n";
    print"<center><table width="125" height=""
    cellspacing="0" cellpadding="0" border="0" bgcolor="#f6f6f6">";
    print "<tr><td width="125" height="240"
    align="center" valign="middle" background="blue_lines_dark.gif">";
    print "<table width="125" height="145"
    cellspacing="0" cellpadding="1" border="2" bgcolor="#000000">";
    print "<tr><td>";
    print "<table width="100%" height="216"
    cellspacing="0" cellpadding="0" border="0" bgcolor="#f6f6f6">";
    print "<tr><td width="" height=""
    align="center" valign="center" bgcolor="">";
    print "<table width="95%" cellpadding="0"
    cellspacing="0" border="0">";
    print "<tr><td>";
    print "<div style="overflow:hidden;
    width:115px; padding-left:1px">";
    print "<font size="+1" face="arial,sans-serif"
    color="#0000ff">";
    print "<a HREF=\"just a URL to be activated
    when the text banner is clicked\" target=_top>";
    print "<b>Pay Day Loans</b></a><br></font>";
    print "<font size="+1" face="arial,sans-serif"
    color="#000000"><b>Need Some Extra Money Until Payday\? ";
    print "We Can Lend You Up to \$1000 <font
    color=red>Today\!</font></b><br></font>";
    print "</div>";
    print "</td></tr></table>";
    print "</td></tr></table>";
    print "</td></tr></table>";
    print "</td></tr>";
    print "</table>";
    }
    vertigo, Jun 28, 2003
    #1
    1. Advertising

  2. vertigo

    Rob McAninch Guest

    Isofarro <news:>:

    > vertigo wrote:
    >
    >> I need to display the text banner inside the sub "credit"
    >> below. I want to call the CGI file, test.cgi, from inside an
    >> HTML file. I need this text banner displayed exactly where I
    >> call it in the HTML file.
    >> What else is need here? I get the error:
    >>
    >> Premature end of script headers

    >
    > You have lots of syntax errors in your script. For example
    > unescaped double quotes in the print statements.


    Indeed. See what it says when you run it from the command line.
    E.g.

    c:> perl -w script.cgi |more

    Piping to more so everything doesn't fly by.

    --
    Rob - http://rock13.com/
    Web Stuff: http://rock13.com/webhelp/
    Rob McAninch, Jul 1, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Moritz Beller
    Replies:
    19
    Views:
    674
    Pete Becker
    Jun 4, 2004
  2. jblazi
    Replies:
    5
    Views:
    421
    jblazi
    Aug 16, 2004
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,764
    Smokey Grindel
    Dec 2, 2006
  4. Patrick Plattes

    Download a file piece by piece

    Patrick Plattes, Nov 30, 2006, in forum: Ruby
    Replies:
    2
    Views:
    195
    Patrick Plattes
    Nov 30, 2006
  5. Replies:
    5
    Views:
    138
Loading...

Share This Page