After some reading and testing, I found that Sambar does indeed still support NPH.

http://www.sambar.com/syshelp/cgi.htm

========================================

Returning Data

CGI programs can return content in many different document types (i.e. text, images, audio). They can also return references to other documents. To tell the server what kind of document you are sending back, CGI requires you to place a short header on your output. This header is ASCII text, consisting of lines separated by either linefeeds or carriage returns (or both) followed by a single blank line. The output body then follows in whatever native format.

If you begin your script output with either "HTTP/" then the Sambar Server will send all output exactly as the script has written it to the client. Otherwise, the Sambar Server will send a default header back (text/html file type) with any data returned from the script. Important: If you do not choose to write the entire HTTP header, you should not provide any special headers, as they will appear as part of the body after Sambar Server processing.

If you begin your script with any of the following:

  • Content-type:
  • Location:
  • Transfer-Encoding:
  • Last-Modified:
  • Set-Cookie:
the Sambar Server will append the appropriate HTTP response status (200 or 302) followed by the headers and content of your script exactly as received.

========================================

The nph-redir.pl included with the Sambar distribution needs a small modification in order to work correctly.

Original script:

sub RedirectUser {
    if ($in{'dest'}) {
        print "HTTP/1.0 302 Found\n";
        print "Window-target: $in{'target'}\n" if ($in{'target'});
        print "Location: $in{'dest'}\n\n";
        exit;

The HTTP/1.0... is not needed; Sambar generates this (per the documentation).

New script:

sub RedirectUser {
    if ($in{'dest'}) {
        print "Window-target: $in{'target'}\n" if ($in{'target'});
        print "Location: $in{'dest'}\n\n";
        exit;

-Jeff

At 10:23 PM 04/22/2004, Jeff Adams wrote:

Really?  When did Tod take NPH support out of Sambar?  It was supported at least as far back as version 4.1.  He used to distribute nph-redir.pl and readme.nph in cgi-bin.  In fact, I just now did a clean install of the 6.0.1 Production server and the files are still being distributed.

You should send Tod a note to tell him to take the files out of the next distribution, since NPH is no longer supported.

-Jeff

At 12:43 PM 04/22/2004, Steffen wrote:

I see that your script is called nph-redir.pl.

To run this, your server must support Non-Parsed Header (NPH) CGI scripts.
Most servers do, but not Sambar.

Steffen

www.sambarserver.info
-------------------------------------------------------
To unsubscribe please go to http://www.sambar.ch/list/


Reply via email to