3 ms·
Read up on http://en.wikipedia.org/wiki/Url_encoding http://en.wikipedia.org/wiki/Url_encoding -- surely php has built in functions to handle this. Note that `
by mooism2 15y ago
Read up on http://en.wikipedia.org/wiki/Url_encoding http://en.wikipedia.org/wiki/Url_encoding -- surely php has built in functions to handle this.
Note that `#` should be encoded as `%23` and that your suggestion of encoding it as `%` results in invalid urls.
Also this means e.g. search result page urls can be passed without resorting to POST.
- keyle 15y agoThanks, but the point was to be able to do it all as GET. Support for POST only became a necessity trying to parse some search engines with parameters in the url.
- mooism2 15y agoYes, you encode `&` as `%26`, `=` as `%3d`, `?` as `%3f` etc. You only need to resort to POST if you would hit length limits with your constructed url.
- keyle 15y agoThanks again, I see your point, but this would make the syntax absolutely obscure. The idea is to keep it simple, to just call ?url=theurl&sel=.simple_stuff I will look at using something else than % as you suggested.
- mooism2 15y agoIt doesn't make the syntax obscure, it makes the syntax standard. Your syntax, being ad hoc, is obscure.