[PHP] URL encode/decode problem
Hi, I have follow problem: One form whitch send some text fields to my PHP script. But before send data, the form makes javascript command escape for text fields. The text fields may contain characters +, quotes, etc. The form post data with GET method. And then I can't get correctly posted data in my PHP script. How to unescape data with PHP? Can someone help me ? Thanks in advance, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
On Mon, 13 Sep 2004 16:51:59 +0300, Rosen [EMAIL PROTECTED] wrote: I have follow problem: One form whitch send some text fields to my PHP script. But before send data, the form makes javascript command escape for text fields. The text fields may contain characters +, quotes, etc. The form post data with GET method. And then I can't get correctly posted data in my PHP script. How to unescape data with PHP? Can someone help me ? stripslashes() perhaps? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
It will not work - Javascript function escape() return string as unicode data - something like %u0431%u043E%u044F. And I don't know how to decode these data as normal chars. Greg Donald [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 13 Sep 2004 16:51:59 +0300, Rosen [EMAIL PROTECTED] wrote: I have follow problem: One form whitch send some text fields to my PHP script. But before send data, the form makes javascript command escape for text fields. The text fields may contain characters +, quotes, etc. The form post data with GET method. And then I can't get correctly posted data in my PHP script. How to unescape data with PHP? Can someone help me ? stripslashes() perhaps? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
On Mon, 13 Sep 2004 17:21:48 +0300, Rosen [EMAIL PROTECTED] wrote: It will not work - Javascript function escape() return string as unicode data - something like %u0431%u043E%u044F. Well, normally I'd say urldecode() but I don't think it handles unicode, so you may wanna check out the multi-byte string functions: http://www.php.net/manual/en/ref.mbstring.php -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
I changed the JScript to encode data not as unicode - now it code data as %20%2B%20. But when I get data with $_REQUEST[var] - I loose symbol + - with code %2B. Greg Donald [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 13 Sep 2004 17:21:48 +0300, Rosen [EMAIL PROTECTED] wrote: It will not work - Javascript function escape() return string as unicode data - something like %u0431%u043E%u044F. Well, normally I'd say urldecode() but I don't think it handles unicode, so you may wanna check out the multi-byte string functions: http://www.php.net/manual/en/ref.mbstring.php -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
On Mon, 13 Sep 2004 18:35:58 +0300, Rosen [EMAIL PROTECTED] wrote: I changed the JScript to encode data not as unicode - now it code data as %20%2B%20. But when I get data with $_REQUEST[var] - I loose symbol + - with code %2B. Can you change it back before you decode it? Maybe with str_replace() ? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
The sending form works with JavaScript. When enter on some field combination + plus sign and space - JScript encode it - I see it with alert - %2B%20 , but when new window opens on url bar shows +%20 - thath means space only. Greg Donald [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 13 Sep 2004 18:35:58 +0300, Rosen [EMAIL PROTECTED] wrote: I changed the JScript to encode data not as unicode - now it code data as %20%2B%20. But when I get data with $_REQUEST[var] - I loose symbol + - with code %2B. Can you change it back before you decode it? Maybe with str_replace() ? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php