I am trying to pass long string variable to another page (fillDB.php) using window.location
window.location = "fillDB.php?encoding_str=" + JSON_encoding_str;
but the string does not passed completely to fillDB.php, here is the code in fillDB.php:
$encoding_str = json_decode($_REQUEST['encoding_str']);
echo $encoding_str;
the string is printed but it is not complete, I do not know where is the problem!
I've assigned value to encoding string:
encoding_str += isSimilar_DB(game)+","+reaction[3]+";";
then used JSON.stringify:
var JSON_encoding_str = JSON.stringify(encoding_str);
to make thing clear:
isSimilar_DB(game)
is a function that returns a long string and
reaction[3]
returns an ID
when passing the whole string JSON_encoding_str, reaction[3] is printed correctely but the returned string(isSimilar_DB(game)) is not complete
EDIT: I've solved the problem. I thought that the problem is the length of the string or the limit length of the URL, but I found that the problem was that the string returned from isSimilar(game) function contained the less than letter "<", so the string is printed until it reach to "<" and stop, I still do not know the reason but any way I replaced "<" with "=" and it worked fine. Thank you all.