[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] CGI on RaQ2 ... ???
- Subject: Re: [cobalt-users] CGI on RaQ2 ... ???
- From: David Sexton <david.sexton@xxxxxxxxxxxx>
- Date: Thu Jan 20 19:34:50 2000
WebMost wrote:
> The problem here is not how Perl works on the RaQ2. The problem is how CGI
> works anywhere. It has to spit back something to the browser, not to the
> shell.
>
> Take a look at your little test script. It prints to STDOUT, not to the
> browser. If you are running it via telnet, it prints "test" and you see it.
> If you want to print to the browser, you are not looking at that screen, so
> you must tell the output to be html. Otherwise, the script just ends and the
> server has nothing to send to the user except an error message. That's why
> the request was incomplete.
CGI output should go to STDOUT, it just has to have a HTTP header.
Specifically, the Content-type header to tell the browser (and server
sometimes) what type of data is being sent. For HTML, use 'text/html' or
'text/plain' for preformatted ASCII. Once you start fiddling with things
like GD, you can even output things like 'image/png' (any other valid
MIME type can be used as long as the remote browser can figure out what
to do with it).
The specs state that a blank line should separate the header(s) from
the body (hence the '\n\n'). You can add other headers also, but these
are generally less useful unless you want to do things like controling
browser caching behaviour etc.
> I suggest you get a good Perl book. Here's how you know if it is good:
>
> Do not read ANY of the book to try to determine if it is the one for you. At
> first, it will all be Greek to you. So long as it is not unduly obfuscated,
> just pay attention to these three rules:
>
> 1) It should be four inches thick
> 2) The binding should be able to withstand years of thumbing through it
> daily
> 3) MOST IMPORTANTLY: It must have a good index.
4) It has a Camel on the front :^)
Dave
--
David Sexton
Network Technician
Sapphire Technologies Ltd.
Tel: +44 (0) 1642 702100
Fax: +44 (0) 1642 702119
-----------------------------------------------
Any opinions expressed in this message are those of the individual and not necessarily the company. This message and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this message in error and that any use is strictly prohibited.
Sapphire Internet
http://www.sapphire.net