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. Advertisements

  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. Advertisements

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. David Prowak

    Why oh why doesn't my data view work?

    David Prowak, Jan 30, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    916
    Alvin Bruney [MVP]
    Jan 30, 2004
  2. Moritz Beller
    Replies:
    19
    Views:
    874
    Pete Becker
    Jun 4, 2004
  3. jblazi
    Replies:
    5
    Views:
    600
    jblazi
    Aug 16, 2004
  4. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    1,371
    Mark Rae
    Dec 21, 2006
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,838
    Smokey Grindel
    Dec 2, 2006
  6. Patrick Plattes

    Download a file piece by piece

    Patrick Plattes, Nov 30, 2006, in forum: Ruby
    Replies:
    2
    Views:
    375
    Patrick Plattes
    Nov 30, 2006
  7. Sara
    Replies:
    6
    Views:
    487
    John W. Krahn
    Apr 12, 2004
  8. Replies:
    5
    Views:
    332
Loading...