I have the following jquery posting to a php page. A var_dump($_POST); on the php page returns null but if I do :
$.post("test.php", {"script" : script} );
everything works.
The reason I do not want to do it that way, is because the array can have variable arguments. Any help?
var arr = new Array();
arr["script"] = scrip;
arr["account"] = "[email protected]";
arr["accounttag"] = "TH";
if (follow != "")
arr["followtag"] = follow;
if (join != null)
arr["join"] = join;
$.post("test.php", arr );
//{"script" : script, "account" : "[email protected]", "accounttag" : "TH"}
//works if used instead of arr
///test.php
var_dump($_POST)
array 0{null};
JSON.stringify()be what you need? developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…