| | |
My CGI Script gives me this error...What am I missing?
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2004
Posts: 15
Reputation:
Solved Threads: 0
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";
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";
:mrgreen:Tim Cummings
•
•
•
•
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.
:?: Sometimes i wonder if i'm on the right planet :!:
![]() |
Similar Threads
- running multiple instances of a same perl-cgi script (Perl)
- Syntax Error - Missing Operator (ASP)
- CGI + custom error pages... (Perl)
- internet explorer script error (Windows 95 / 98 / Me)
- Internet Explorer script error (Web Browsers)
Other Threads in the Perl Forum
- Previous Thread: i use perl
- Next Thread: contribute to my program
| Thread Tools | Search this Thread |
Tag cloud for Perl





