943,890 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 5539
  • Perl RSS
Jul 23rd, 2004
0

My CGI Script gives me this error...What am I missing?

Expand Post »
When my CGI script is given input from my web page I get this error:

Server error!

The server encountered an internal error and was unable to complete your request. Error message:
Premature end of script headers: projest.cgi
Does anyone have a clue as to what I'm missing here? I would appreciate any helpful suggestions.

Thanks,

Tim



#!/usr/bin/perl
# Program name: projest.cgi

require "subparseform.lib";

&Parse_Form;
$projcost = $formdata{'projcost'};
$projects = $formdata{'projects'};
$revenue = $formdata{'revenue'};

$average = $projcost/$projects;
$average = sprintf("%.2f", $average);
$grossprofit = $revenue-$projcost;

print "Content-type: text/html\n\n";
print "<P>Project Cost Last Year was $projcost dollars.";
print "<P>We completed $projects projects during the year.
That works out to an average of $average cost per project.";
print "<P>Our annual Project Revenue was $revenue dollars.
We made a gross profit of $grossprofit dollars";
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tccummings is offline Offline
15 posts
since Jul 2004
Sep 1st, 2004
1

Re: My CGI Script gives me this error...What am I missing?

Quote originally posted by tccummings ...
Premature end of script headers: projest.cgi
This usually means that the cgi script does not print anything, so probably it is generating an error. I would guess it cannot find the lib.

:!: If you use CGI::Carp, you can show the CGI script errors in the browser so you can see what is going on.
Reputation Points: 13
Solved Threads: 0
Light Poster
DeepZ is offline Offline
27 posts
since Sep 2004
Sep 1st, 2004
0

Re: My CGI Script gives me this error...What am I missing?

As it turns out you are probably right. My instructor told me there was absolutely nothing wrong with my script. Most of the people in my class were getting the same error. I looks like there was something wrong with the college's CGI server. Thanks for your input.

-T
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tccummings is offline Offline
15 posts
since Jul 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: i use perl
Next Thread in Perl Forum Timeline: contribute to my program





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC