How do i encode url

Hi, can i ask how can i encode paramters in the url,because i am passing variables to other page and i want that the url will encoded or the value of paramter ,.i am using

Thank you in advance.

Hi jemz,

depending on what you are trying to achieve you will want either encodeURI() or [URL=“”]encodeURIComponent()

See also:

Hi pullo,

Thank you for the reply…so this is intended only for the query string as for encodeURI and encodeURIComponent?..but how can i encode if i have this kind of parameter


now i don’t want the user know the empid is 4,is it possible to do some hash something like this


because i am afraid that if the user will change the url or something like he will guess and change this to no. 5 or any no… the new page will load and some information will be seen.

can you help me on this please.

Thank you :slight_smile:

Hi jemz,

Then you need some kind of authentication system in place.
A user should not be able to get at sensitive information by guessing a url.
Simple as that, I’m afraid.

Thank you pullo :slight_smile: