http / browser help: changing url in location window

Ben Scott dragonhawk at gmail.com
Wed Feb 1 13:11:02 EST 2006


On 2/1/06, Python <python at venix.com> wrote:
> However, some forms become irrelevant depending upon the responses.  In
> that case, the irrelevant form(s) are skipped and the next usable form
> is presented.  However, the URL displayed in the browser came from the
> last form action and shows the URL for the first skipped screen.

  So send an HTTP redirect to the URL you want.

> Using a Location header with status 302, 303 forces a GET (not a POST)
> to the new location ...

  Yup.  That's what an HTTP redirect does, and it's what you're asking for.  :-)

  Unless you're asking for "Load one URL, but display a different URL
in the location bar, even though that URL is never loaded."  One major
problem with *that* is that phishing attacks want to do the exact same
thing.  So if you find a way to do it, I recommend submitting it as a
bug to the Mozilla project and have them fix it so you can't do it. 
Seriously.

> I do not want to do the necessary programming to support GETs.

  GET and POST basically do the same thing, and most toolkits abtract
the difference away anyway.  There really shouldn't be any programming
differences.  If there are, my first feeling would be, "Find a better
toolkit".  :)

> (The site management has a policy against cookies, and I can't think of
> any other way to maintain a session through a GET.)

  Well, the unmitigated fear of cookies is somewhat irrational. 
However, the fact remains that some people refuse to allow them under
any circumstances, so one sometimes has to program around the problem.

  So: Rather then tracking state in a cookie, track it in a form
variable.  Said form variable can be submitted via GET or POST.

-- Ben



More information about the gnhlug-discuss mailing list