Mike Wannamaker wrote: > Usually in forms the space is replaced with + or %20. I thought that if you > use the submit on a form then it would handle encoding all special characters? > I didn't think it mattered whether get/post. If you are using a form and then > when a button is clicked you are trying to submit your own request then you > would have to encode the values yourself.
Yes. In fact, after I sent my previous message on this topic to the list, Witold (the original poster) sent me a reply saying that was exactly what was happening. Unfortunately, this wasn't posted to the list. See below. > Thanks for the reply. > That's exactly what happened - when I redirect the request to different > page I rewrite all parameters without taking care about the %... > Thanks > Witold On 28 May 2002 at 17:45, Alastair Rodgers wrote: > '%' is used to refer to characters by value, e.g. %20 is a space char. > Hence, you need to ensure your parameter values are URL encoded or the > URL will get screwed up. If you have an HTML form, such as: > > <form name="theForm" action="myurl" method="post" > enctype="multipart/form-data"> ... </form> > > then the browser should take care of URL encoding all parameter values > that you enter through form input fields. This will ensure that '%' is > appropriately escaped. > > However, you need to be careful if your form isn't submitted > 'directly'. For example, your page could have JavaScript coded so that > when you perform some action (e.g. click a button) it builds up a URL > with a query string consisting of the name/value pairs of all the > input fields contained in theForm then navigates the browser to this > new URL. If you do something like this, then your JavaScript must > explicitly URL encode the parameter values (and names, if necessary) > before appending them to the new URL string. > > > Regards, > Al. > To change your membership options, refer to: http://www.sys-con.com/java/list.cfm
