Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Please help--queer problem with using Netscape to get into my CGI web site

Posted on 2000-03-06
1
Medium Priority
?
166 Views
Last Modified: 2013-12-25
Hi,

I have written a simple web page which has a login HTML form to let you get into a CGI (.exe) part of the web page which accesses databases, etc.  When you press the Submit button, the host runs the CGI program which decides whether to let you into the database.

I have stored the program in /cgi-bin which has execution enabled only and the databases are stored elsewhere.

The site works great with IE4.

If I use Netscape (4.5/4.7), when I press the submit button, the output of the CGI program is not displayed in the browser but instead you are offered a FileSave dialog.  If you save the file (named by the name of the program executable) and open it, it contains the Body of the output of the CGI program!  No headers, just the body tags and everything between.

I've tried various things including rewriting the simple page manually, using Dreamweaver to write it, used previously written web pages which sent form data to a Perl CGI program, but none of that works.  I've also looked closely at the pages returned by other Internet CGI programs.

I don't know where the problem could be.

Surely it can't be that hard!

//Writeln('<!doctype html public "-//w3c//dtd html 4.0 transitional//en">');
  Write('<html><head>');
  Writeln('<title>whatever</title>');
//Writeln('Content-type: text/html');
//Writeln('  <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Mac">');
  Writeln('  <META HTTP-EQUIV="CONTENT-Type" CONTENT="text/html; charset=iso-8859-1" />');
  Writeln('</head>');

Any ideas?  URL available if necessary but I don't want to broadcast it here.

Thank you!
MP
0
Comment
Question by:mikepj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
makerp earned 400 total points
ID: 2588237
the content type header must be the first thing to go out to the browser and must be followed by two newline chars

ie

printf("Content-type: text/html\n\n");

any other headers you wish to put out can go before or after this but the last header must have a double newline after it. there must be a single newline between headers

your probably getting away with it in ie as its a bit more tolerent !!

printf("Content-type: text/html\n\n");
printf("<H1>hello world</H1>");

0

Featured Post

Quick Start: DOCKER

Sometimes you just need a Quick Start on a topic in order to begin using it.. this is just what you need to know to get up and running with Docker!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

704 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