• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Do you know what this error means?

Nfau

New Member
[Tue May 29 12:54:22 2001] [error] [client 203.54.XX.XX] Premature end of script headers: /home/XX/www/downloads/filereview.cgi
 
Before a script can print any text to the visitor's browser, it needs to issue at minimum certain HTTP headers: either a Content-type header or a Location header (and others if you want). Is it possible that either these headers were not issued prior to printing text or that somehow or other the headers were malformed (or the process was terminated), etc?
 
Code:
#!/usr/bin/perl 

require "filereview.setup";



use CGI;
	$q = new CGI;

$cat = $q->param('category');
if($cat){ $link_file = "$filedir/$cat.dat"; }
else { $link_file = "$filedir/$default.dat"; }
&category;
&search;

	open(BRAVO, "$link_file");
	   if ($display == 1)    { @johnny = reverse(<BRAVO>); }
	   if ($display == 0)    { @johnny = (<BRAVO>); }
close(BRAVO);

print "Content-type: text/html\n\n";
print &Template("$templatedir/display_top.html");
 
I'd change the last line to

print "hello";

then try it

if that works then you know the problems in the template function?
 
Place the print statement for the Content-type header at the top of the script.

It's possible that your other subroutines are attempting to print before that.

-mk
 
Back
Top