【发布时间】:2015-07-18 21:45:21
【问题描述】:
我遇到了一个烦人的问题。我在 Google App Engine 上有一个应用程序,它通过 POST 从 JS 向 php 页面发送一些数据(格式为 JSON 字符串)。但是当我选择超过特定数量的数据时,根本不会返回任何内容。我已经尝试将 post_max_size 增加到 20M,但不是更好。那么这里的限制在哪里呢?还有另一种可能将数据从 JS 获取到 PHP 吗?我试过这样:
function openWindowWithPost(url, name, keys, values) {
var newWindow = window.open(url, name);
if (!newWindow)
return false;
var html = "";
html += "<html><head></head><body><form id='formid' method='post' action='"
+ url + "'>";
if (keys && values && (keys.length == values.length))
for (var i = 0; i < keys.length; i++)
html += "<input type='hidden' name='" + keys[i] + "' value='"
+ values[i] + "'/>";
html += "</form><script type='text/javascript'>document.getElementById(\"formid\").submit()</sc"
+ "ript></body></html>";
newWindow.document.write(html);
return newWindow;
}
【问题讨论】:
标签: javascript php google-app-engine post