list at joreybump.com
Mon Jul 5 22:57:05 EDT 2004
mod_python user wrote: > Hi all, > > I'm new to python and consequently mod_python but have discovered the > servlet" package, and actually have a small templated webapp up and > running. Extremely powerful language. > > I would like to be able to retrieve both _form_ and _query_ variables, > even if they share the same name. e.g. > > <form method='post' action='/?name=NAME_ONE'> > <input type='hidden' name='name' value='NAME_TWO' /> > <input type='submit' /> > </form> > > It seems that when both a GET and POST variable share the same name that > the GET (query) variable always wins. > > Does anybody know how this might be accomplished? I don't know about servlets, but mod_publisher returns a list: ['NAME_ONE', 'NAME_TWO'] I don't know what causes this behaviour. Since only a POST request is sent, not a GET, I would expect any arguments in the URL to be ignored and only variables in the message body to be recognized. I'd find out if this follows some kind of standard before relying on the order the values appear in a list. It could be arbitrary or undocumented (and therefore unpredictable).