PDA

View Full Version : Why Malformed header in 9 lines of code


hogtied
02-06-2003, 12:03 AM
Hello,

I have this cgi just to test. All it suppose to do is write "print test" in a text file called accstats.txt.

Here's the script.

#!/usr/local/bin/perl

print "Content-type: text/html\n\n";

$accstats = "accstats.txt";

open (FILE, ">>$accstats");
print FILE "print test";
close (FILE);

I called my web hosting provider and they said that there is nothing wrong at their end. I find that hard to believe.

Anyone have anything to say about this. The more the better because this is the post I'm going to show them.

Thanks,
Hogtied :mad:

crackn101
02-06-2003, 01:05 AM
Hi.
Worked just fine on my server.
Be sure that you upload in ascii only.
Can't always rely on the ftp 'auto' mode.
Unless you have specifically setup the pl or cgi extension to
always upload in ascii, I've seen it upload in binary before.

Even though it doesn't return anything to the browser,
you still took care of the content-type.

Not sure.

Crackn101

pb&j
02-06-2003, 06:52 AM
Did you check the CHMOD of the file(s) ?

hogtied
02-07-2003, 06:52 PM
Good call crackn101. I upload the file as a binary. Thanks