Namazu-users-en(old)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Form POST method



On Fri, 14 Dec 2001, Subramanian Radhakrishnan wrote:

> when i use post method, i am not getting any search results. But
> when i use get method, I am getting search results..

It is much harder to support post than it is to support get.  Using get,
the query string is passed as environment variables, which makes reading
them a simple matter of doing a getenv().

Using post, they are passed as an encoded string on stdin, and the
length passed in the Content-length header.  Not all browsers pass the 
correct content-length however, and sometimes they do not account for 
endline characters (\n instead of \r\n).

The easiest way to do this would be to use cgilib, but as of now namazu 
does not use cgilib.

If you really want to try your hand at it, have a look at src/cgi.c, in 
the function get_query_string  (a grep for QUERY_STRING would have shown 
you).

You'll have to change the getenv call to something that reads the post 
info.

An alternative is something that I've done at 
http://mm.ilug-bom.org.in/mailman/search/linuxers/
and
http://mm.ilug-bom.org.in/mailman/search/life/

The index is actually passed as the PATH_INFO variable.  In the above 
url, linuxers and life are the indexes, but isn't apparent to users of 
the search.

The changes were quite easy to do, and I can post a patch (on 2.0.7) if 
you want.

Philip

-- 
If builders built buildings the way programmers wrote programs,
then the first woodpecker to come along would destroy civilization.


Visit my webpage at http://www.ncst.ernet.in/~philip/
Read my writings at http://www.ncst.ernet.in/~philip/writings/

  MSN  philiptellis                         Yahoo!  philiptellis
  AIM  philiptellis                         ICQ     129711328