Search code examples
character-encodingurl-encoding

URL value encoding Causing 404


I have a select box with an option like this:

<option value="Korea,_North">Korea, North</option>

On submit of the page, MySQL expects "Korea,_North" as the value however the comma is encoded as %2C in the URL instead like: "Korea%2C_North" which causes a 404.

How can I prevent encoding from happening and pass the "," character through the URL?


Solution

  • , is a reserved URL character - that's why it's being encoded. It shouldn't be a problem though, PHP (looked that up in your profile) for example automatically decodes it. So if you are doing the normal $_POST/$_GET thing, then this is not your problem.