次のjqueryをphpページに投稿しています。var_dump($_POST);
PHPページのAはnullを返しますが、そうすると:
$.post("test.php", {"script" : script} );
すべてが機能します。
そのようにしたくない理由は、配列が可変引数を持つことができるからです。何か助けはありますか?
var arr = new Array();
arr["script"] = scrip;
arr["account"] = "max@hotmail.com";
arr["accounttag"] = "TH";
if (follow != "")
arr["followtag"] = follow;
if (join != null)
arr["join"] = join;
$.post("test.php", arr );
//{"script" : script, "account" : "max@hotmail.com", "accounttag" : "TH"}
//works if used instead of arr
///test.php
var_dump($_POST)
array 0{null};