textarea不会发布在$ _POST中 [英] textarea is not posted in $_POST

查看:96
本文介绍了textarea不会发布在$ _POST中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的表单,其中包含一个 textarea 字段,发布时, textarea 不会发布到目标页面。我在网上尝试过许多解决方案,但都没有工作。任何想法如何解决?

I have a simple form with a textarea field inside it and when posting, the textarea is not posted to the target page. I have tried many solutions on the web but none of them worked. Any idea how to fix it ?

HTML:

<form action="new_page.php" method="post" id="userform">

    <p>Content:<br />
    <textarea name="content" rows="15" cols="80" form="usrform">Enter your text</textarea>
    </p>
    <input type="submit" name="submit" value="Create page"/>
   </form>

new_page.php中的PHP:

PHP in new_page.php:

$content = htmlspecialchars($_POST["content"]);
echo $content;


推荐答案

删除 form =usrform 从您的文本区域,您的代码将工作。

Remove form="usrform" from your textarea and your code will work.

[或]

在您的文本区域将 usrform 重命名为 userform 也可以正常工作。

Renaming usrform on your textarea to userform will also work.

这篇关于textarea不会发布在$ _POST中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆