There is a script that accepts a specific character set from a form. Everything works correctly, until among the characters do not appear "+", "&", "\", "/" Please tell me, how can I transfer such data? Zaran
2 answers
You need to use the urlencode and urldecode functions.
The first replaces the special characters with the correct URL representation, and the second, respectively, vice versa.
|
If you form a string for the client-side GET method (in the browser), then send it, then use the encodeURIComponent function when generating a request in javascript.
If the string for the GET method is formed on the server side, then use the urlencode function to convert the string (and urldecode to decrypt later).
In general, it is better to use the POST method for data transfer.
|