problem with + character
Brought to you by:
thaberkern
Hello
there is a problem with + character,
for example,
in javascript, before calling x_* procedures i got:
var a = 'tralalalala+bkadksdk+dsdasda+sdfsd';
x_callmyajax(a, DoSomething, onDoSomething);
in php function i will receive:
a = "tralalalala bkadksdk dsdasda+sdfsd";
(all + characters are replaced with whitespaces)
of course this brokes up base64_encoding and decoding
which sometimes uses + characters
sebastian
Logged In: YES
user_id=1550693
problem solved
before passing variable to x_callmyajax do something like
this to preserve the + characters:
a = encodeURIComponent(a);
then, in php, you can easly restore original string by
$a = rawurldecode($a);
nice url with infos:
http://xkr.us/articles/javascript/encode-compare/
best regards,
sebastian