in reply to Reinventing wheels: query string parsing.

Can you guarantee that the fields will occur in the query string in the same order as they appear in the page? I think most browsers do this but you may get a nasty surprise in the future if one of them changes.

  • Comment on Re: Reinventing wheels: query string parsing.

Replies are listed 'Best First'.
Re: Re: Reinventing wheels: query string parsing.
by BUU (Prior) on Jul 27, 2003 at 21:10 UTC
    hrm. Thats a good, if nasty, point. I was under the impression that most will do it that way, but your quite right that if they arbitraily inserted form elements then bad things could happen. Fortunately that will only affect <form>s so I can still use manual links to set the query string or something..

      If you're only using manual links, you can construct the link such that the parameters submitted use the "standard scheme." This may mean doing more processing before generating the URL, but the code will probably end up more understandable that way -- the translation code will make clear exacly how your variables will be used. Just a thought...

      perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'