Textarea不发送长文本,短文本也可以

发布于 2024-12-23 06:44:10 字数 753 浏览 0 评论 0原文

我有表单:

<form method='post' action='script.php'>

    <textarea id='main' name='text'></textarea>

    <input type='hidden' name='id' value='1'> 
    <input type='hidden' name='a' value='ulozitclanek'> 
    <input type='submit' name='button' value='Save'>

</form>

如果我在文本区域中输入短文本并提交,那么在 script.php 中,我的文本已经在变量 $_POST['text'] 中。但是,如果文本长度约为 70000 个字符,则它不在 $_POST['text'] 中。我可以从 Firebug 中看到网络日志,并且我的文本采用编码字符串形式,由浏览器发送到服务器。但在 $_POST 数组中我的文本丢失了。

这个问题我只在生产服务器上遇到,当我在本地主机上测试这个脚本时,它也适用于长文本。

是否有任何服务器选项限制 post 值的 maxlen?

在PHPinfo中,我可以看到post_max_size设置为20M,肯定还有另一个问题,但我自己解决不了:-(

有什么想法吗?

坦克。

I have form:

<form method='post' action='script.php'>

    <textarea id='main' name='text'></textarea>

    <input type='hidden' name='id' value='1'> 
    <input type='hidden' name='a' value='ulozitclanek'> 
    <input type='submit' name='button' value='Save'>

</form>

If I type short text into a textarea and submit, then in script.php I already have my text in variable $_POST['text']. However if the text is about 70000 character long, it isn't in $_POST['text']. I can see net log from Firebug and my text is in encoded string, which was sent by my browser to the server. But in $_POST array is my text missing.

This problem I have only on production server, when I test this script on localhost, it works also with long texts.

Is there any server option, which limits maxlen of post values?

In PHPinfo, I can see post_max_size set to 20M, there must be another problem, but I can't solve it on my own :-(

Any ideas?

Tanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

失退 2024-12-30 06:44:10

根据 Eda 的评论

问题已解决。服务器上的 POST 变量受到限制。感谢
您的时间并注意虚拟主机配置。我已经失去了好几个
解决这个问题需要几个小时

As per Eda's Comment

Problem solved. It was limit for POST variables on server. Thnx for
your time and be careful about webhosting config. I've lost several
hours by solving this problem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文