Solved

Content-Type: doesnot/work

Posted on 1998-09-01
2
176 Views
Last Modified: 2010-03-05
If someone can help me with this, I will give them all the points i have left.

I have written a few scripts that work fine in Internet explorer - however - when run on netscape they screw up (well it appears they do)

Whenever I get the input from a form, i use the get method, and before I start printing any HTML I am putting the expected - print "Content-type: text/html\n\n"; at the start. THIS DOES NOT WORK. In explorer, I get the words 'Content-type: text/html' at the top left of the page. and then I get the correct output from the rest of the code.

In netscape, I get a dialog telling me that I am trying to download a file of MIME type application/x-perl, when I am trying to display a text/html file (which I have told the HTTP header. I can then save or open the file - or cancel. The file is the output that should have gone to screen.

WHAT IS WRONG!?????

Please Help
0
Comment
Question by:infoatags
2 Comments
 

Accepted Solution

by:
matthewallum earned 160 total points
ID: 1204657
Im guessing here that you are running PERL on a Windows machine.
What you need to do is add this line just before the print "Content-type: text/html\n\n" ;

print "HTTP/1.0 200 OK\r\n" if $ENV{PERLXS} eq "PerlIS";

For some reason (I cant rember what) you need to pass extra header info on a windows server running PERL. This should fix your problem
0
 

Author Comment

by:infoatags
ID: 1204658
U BLOODY LEGEND!!!Why were you not around a week ago??
Can I get your email address if I have further questions (though I doubt I will)
email me at john@activegs.com.au if I can get ur email addr.

Thanks heaps
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now