RE: cgi (correction)
- Posted by Cassidy Napoli <gonzotek at yahoo.com> Oct 11, 2001
- 377 views
Rolf, I disagree, respectfully. Please read this document: http://hoohoo.ncsa.uiuc.edu/cgi/out.html Essentially, there are three kinds of "Parsed headers": ---- Content-Type - The type of document you are returning -or- Location - Is a reference to another document. -or- Status - A status messagte, like 404 Forbidden. ---- You only need 1 of these. The browser wouldn't know what to do if you sent more than 1. If I were generating dynamic html on-the-fly, I would be using Content-Type: text/html. But I'm not even sending back text. I'm sending an image (I've changed it to gif, finally). So even if I had to use Content-Type, it would be Content-Type: image/gif. But then I would have to know how to send a binary file with puts(), and I don't think I'm up to that. Location: is essentially a redirection, a pointer to the file you want the browser to retrieve. -=Cassidy=- rolf.schroeder at desy.de wrote: > Correction, this must be the first output of the cgi based program: > > puts(1,"Content-Type: text/html\n\n") -- Essential for CGI execution! > > Sorry, and have a nice day, Rolf