Archives for the 'HTTP' Category

Encode Your URL Parameters

If you wish to query a URL using the HTTP GET method, problems will arise if your parameters contain characters such as ? and &.
The solution is to use encodeURIComponent (client-side Javascript) or Server.URLEncode (ASP) or urlencode (PHP).
There is no need to do any extra work at the server side for Request.QueryString(”…”) or $_GET[”…”].
encodeURIComponent example:
location.href […]

21 October 2006 | Software engineering, HTTP, Javascript, ASP, PHP | No Comments