Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php从文本区域获取值时出错_Php_Html_Textarea - Fatal编程技术网

php从文本区域获取值时出错

php从文本区域获取值时出错,php,html,textarea,Php,Html,Textarea,嘿,伙计们,在这个表单中,我很难从我的textarea中捕获值,我可以读取name和email的第一个值,但是当php代码尝试读取textarea的消息时,它会返回一个错误。有人能帮我找出我的代码有什么问题吗?顺便说一句,我仍然在这里写作,因为我需要填满这个空间,但这句话与问题并不相关。谢谢 HTML: PHP: 从文本区域中删除name=“name”属性: <textarea class="form-control" name="name" rows="4" cols="80"

嘿,伙计们,在这个表单中,我很难从我的textarea中捕获值,我可以读取name和email的第一个值,但是当php代码尝试读取textarea的消息时,它会返回一个错误。有人能帮我找出我的代码有什么问题吗?顺便说一句,我仍然在这里写作,因为我需要填满这个空间,但这句话与问题并不相关。谢谢

HTML:



PHP:


从文本区域中删除
name=“name”
属性:

<textarea class="form-control" name="name" rows="4" cols="80" placeholder="Type a message..." name="MessageForMe"></textarea>

致:

<textarea class="form-control" rows="4" cols="80" placeholder="Type a message..." name="MessageForMe"></textarea>
<textarea class="form-control" rows="4" cols="80" placeholder="Type a message..." name="MessageForMe"></textarea>




您在textArea字段中使用了两次
名称
属性
。删除
name=“name”
,并将其更改为以下内容。现在应该可以了


<textarea class="form-control" rows="4" cols="80" placeholder="Type a message..." name="MessageForMe"></textarea>
<textarea class="form-control" rows="4" cols="80" placeholder="Type a message..." name="MessageForMe"></textarea>