Hi Alex:
    I'm a rebol newbie, but have done a lot
of CGI programming, and have had to resolve
a lot of headaches myself. One of the things
that I do is build in switches to send my
content to a physical file if necessary.  Often
times that is helpful, other times, one may actually
want to build static pages with the same code.

see http://www.rebolforces.com/cgi-util.html
also
http://www.rebolforces.com/cgi-basics.html
and
http://www.rebolforces.com/
good stuff there

You will find redundant and sloppy code in
cgi-util because I am very new to rebol,
but some useful stuff, I hope. Look for
functionality around re-direction of output.

Your comments, questions, and criticisms will
be appreciated. They will make me a better
rebol programmer.

You may email me directly if you wish.
regards
Tim

[EMAIL PROTECTED] wrote:

> >- Open Your Mind -<
>
> [[[ MY-MESSAGES-TO-FEEDBACK-KEEP-BOUNCING-BACK MODE ON ]]]
>
> I've been going mad due to a malfunctioning CGI script. It wouldn't even tell me 
>what the error was, I just got a generic error page.
>
> I've spent many hours trying to understand what the problem was, then I used a dirty 
>trick (I simulated its execution *by hand*) and found out that the Content-Type 
>wasn't being issued because there was a loading-time error, so even the very first 
>instruction ( print "Content-Type: text/plain^/" ) wasn't executed. This happened 
>online only, the offline execution was OK. Argh.
>
> Now the problem's solved, but it would be nice'n'useful to have a command line 
>option to make sure that, in case *anything* gets written to standard output, the 
>very first thing printed is "Content-Type: text/plain^/" or some other Content-Type.
> Now, if the script issues "Content-Type: text/plain^/" itself, that's OK, if the 
>script issues "Content-Type: text/html^/" that's OK, if the script issues 
>"Content-Type: movie/sci-fi^/", that's OK... but if the script issues anything else 
>or if there's an early error, the REBOL interpreter issues "Content-Type: 
>text/plain^/" *first*. So we can see what the hell's going on. :-)
> I realize this would bring performance down a bit, so it should be a separate, 
>non-default choice. I was thinking something like --cgidebug or -d, like this:
>     REBOL --cgidebug --secure none cgi-script.r
>     REBOL -ds cgi-script.r
>
> Or at least have "Content-Type: text/plain^/" printed before any early error message 
>when using the standard --cgi ((-:
>
> [[[ MY-MESSAGES-TO-FEEDBACK-KEEP-BOUNCING-BACK MODE OFF ]]]
>
> Alessandro Pini ([EMAIL PROTECTED])
>
> "Dave, about that monolith..." "Yes, HAL?" "Have you tried the switch?" (-O HAL 9000 
>& Bowman :-)

Reply via email to