Reputation: 61
I want to encode the URL including its path in PHP.
For eg: As of now,my path is www.yoursite.com/code/results/show.php?u=10&n="tom"
.
I want to encode this URL so that user should not be able to see the
"/code/results/show.php?u=10&n="tom"
.
Why I need this because
Thanks in advance.
Upvotes: 2
Views: 92
Reputation: 51
the problem is not with url, URL should be used to only identify resource, if you want to hide something then it should not reach (be part of URL) client in the first place.
Upvotes: 0
Reputation: 602
best way to hide critical information is to keep it secret, instead just use a reference and get the information from the database.
in general its no good sign if security depends on how user are sending requests.
Sending it with POST
would hide it, but not really... there are various ways to get and manipulate post-data.
Upvotes: 0
Reputation: 3002
You will need to look into .htaccess
files, from there you can perform url rewrites that will take a url of (for example) www.yoursite.com/code/results/show.php?u=10&n=tom
and instead output www.yoursite.com/results/10/tom
.
If the u=10&n=tom
is important, it can't be removed entirely from the URL, however it can be masked in the above way, the alternative is to do everything with POST
, which is not a good way to go.
Take a look at this link: http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/
Upvotes: 2