I want to hide parameters from URL. I’m using uuids instead of ids and when I pass it in URL it looks a bit long and ugly. First thought was to use little forms with hidden inputs istead of anchors, but it will be uncomfortable to replace every one anchor with form, also it will not work when an anchor is placed in another form already.
So second thought was rewriting $_GET to $_POST/$_SESSION and then redirect again to this script. All variables will be available and the URL will be clean and short.
But what with performance of this solution? Is it a good idea to do it this way?
Any help or other ideas will be appreciated. Thanks in advance.
PS.
Don’t change GET to POST or vice versa for prettiness. Both HTTP methods are handled very differently in many contexts, and you don’t want to cause these kind of side effects.
POST requests cannot be self-contained in a URL, i.e. try to send someone the link to a site that requires a POST request. POST requests screw with browser history, i.e. try clicking the back button to go back to a page submitted via POST. POST requests aren’t indexed by search engines.
POST requests are supposed to be used to modify data on the server. Don’t use them for all regular requests.
If you need prettier URLs, find some other way to reference your records. Or just stop caring about it, it’s really not that important.