I've inherited terrible code in the past, but one idea in there struck me as a logical step. It's to use non-standard get queries for links inside the application.
So instead of
/search?category=23&city=Venice
when applicable, use
/search/category-23;city-Venice
These kind of uris get parsed for comfortable use by the system and any $_GET
params can still come at the end of the uri.
The main advantage is that no outside link with say referrer information, or (much more importantly) requests from other services like banks will by chance override information in the specially formated query.
I realize the many downsides of this approach and as mentioned this notation is only used where appropriate.
The question is, are there any best practices in doing such a thing, as I'm reimplementig this particular functionality and would rather use a premade solution (the key-value;
format does not have to stay).
P.S. I can't believe [best-practices]
is no longer a tag :/
EDIT: I might have been misunderstood. I still use GET, I just want some extra information embedded in the URL that can't accidentally be overriden by outside requests or whatnot.
I do need this functionality I'm just asking are there any practices. For example I found out yesterday, skype (and I suppose other services too) strip the leading ;
, when auto-linkifying, so it's better to use, say | as the separator.