Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI Error

Status
Not open for further replies.

brad75

Programmer
Nov 28, 2001
8
US
Hi guys, I'm getting the following error when I hit the submit button on a form I created:

"The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:"

i've checked my path to the perl script and everything seems fine..actually, this form was working fine just a couple of days ago, and something weird happened and threw it off... any help will be very much appreciated.....
 
Try adding this line below your shebang line.
print ("Content-Type: text/html\n\n");

//Daniel
 
thanks for ur help Daniel, but the print method is not working for me....i'm using NT/IIS..any more ideas please?
 
brad75, I haven't used Perl on NT/IIS before, but I can't believe that "print" doesn't work. I normally don't use the parenthesis - try this:

#!/path/to/perl -w

use strict;
print "Content-Type: text/html\n\n";

### the rest of your code ###

and see if that does it.

Actually, I think end-of-line is different on NT and Windows - I wonder if you have to give \r\n\r\n at the end of the Content-Type instead of just \n\n.

HTH.
Hardy Merrill
Mission Critical Linux, Inc.
 
Hi HTH,
i've added the print statement...i've run the program to check for syntax errors: no errors..i've checked my path, installation, everything seems to be in place, but the THING is still not working....the weird thing about it is: it was working three days ago and all of a sudden I get this error:
"The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:" and it doesn't even mention what 'headers' it's talking about...any more ideas guys??? Eliza Gyampoh
N/L Tech
 
If it's on a unix box, make sure that you upload it as ASCII instead of binary. It's an easy mistake to make, and will cause just the problem you mention. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
do other perl scripts work properly?

maybe the ISS config is the problem.....
 
I've checked the IIS conf and nothing seems to be wrong....
I'm still getting this error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


here are my first two lines of code: #!D:\Perl\bin\perl.exe
print "content-type:text/html\n\n;"
i doubt if the problem is from the coding 'cos i run it and i'm not getting any syntax errors...any more ideas please Eliza Gyampoh
N/L Tech
 
If you didn't make a typo in your post then in the Content type line above, the semi colon should be at the end of the line outside the quote.
Grizz2
 
Also there should be a space after between the colon and the text/html, and I think the word content should be capitalized. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top