durusmail: quixote-users: An issue
An issue
2001-11-22
2001-11-23
2001-11-23
2001-11-23
2001-11-23
An issue
Greg Ward
2001-11-23
On 23 November 2001, Mikhail Sobolev said:
> Sorry, I do not get it. :(  If I understand correctly, everything after
> '?' will be consumed by form.

The query string will be consulted to generate the form variables, but I
don't think it's "consumed" -- it should still be there in environment
variables like QUERY_STRING and REQUEST_URI.  If the query string can't
be parsed as a string like "?var=value&var=value&...", then no form
variables should be set.

> If you do use such a construction, I'd
> suppose that you "hack" the query string directly...  That's what I
> tried to avoid.

Correct.  I agree with you about avoiding that kind of hack, but I
didn't write the code on our site that uses it, and it *works*, so I'm
not going to complain too much.  And it is a legitimate, if slightly
unusual, use of URL query strings.

> I'm trying to implement a simple log.  You can list entries, add
> entries, view entries.   For that I see the following set of URLs:
>
>     .../log             -- gives basic information about the log
>     .../log/  -- shows the specified entry
>     .../log[/]?entry=id -- seems to be also necessary for forms
>     .../log/list        -- view a number of recent entries
>     .../log/list/all    -- view all of them
>
> The error I got for the third case.  Without thinking I put 
action=".../log">...
and got an error, when I changed it log/, > it started to work, but what I thought was understanding of some kind, > left me. :) Right, that makes perfect sense to me. ".../log" is a namespace, so ".../log" won't work as a URL -- it needs to be ".../log/". That's true whether you tack on a query string or not. Quixote *can* fix that for you (set FIX_TRAILING_SLASH true), but it's not recommended in a development environment, because it can hide programming errors like yours. Then you release the code and your users are stuck with an unnecessary redirect, ie. an extra request/response cycle is needed. However, I believe that Quixote is also broken in how it handles FIX_TRAILING_SLASH in the face of a query string, based on my experiments on our live site. Haven't looked at the code yet. So in your case, it's just as well that you didn't set FIX_TRAILING_SLASH -- you would have switched from being bitten by your own mistake to being bitten by a Quixote bug. ;-) Greg -- Greg Ward - software developer gward@mems-exchange.org MEMS Exchange http://www.mems-exchange.org
reply