Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/251.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 $\u未使用简单表单的POST_Php_Post - Fatal编程技术网

Php $\u未使用简单表单的POST

Php $\u未使用简单表单的POST,php,post,Php,Post,我真的不知道为什么会这样,但是我的简单PHP表单没有使用$\u POST变量,返回了一个错误 HTML格式: <form name = "post" action = "insert_into.php" method = "post"> <p><label for="author">Author:</label></p><input type = "text" id = "author" name = "author">

我真的不知道为什么会这样,但是我的简单PHP表单没有使用$\u POST变量,返回了一个错误

HTML格式:

<form name = "post" action = "insert_into.php" method = "post">
<p><label for="author">Author:</label></p><input type = "text" id = "author" name = "author"> 
<p><label for="subject">Subject:</label></p><input type = "text" id = "subject" name = "subject">
<p><label for="content">Content:</label></p><textarea id = "content" rows = "8" cols = "40" name = "content"></textarea>
<br />
<input type = "submit">
</form>
错误:

Notice: Undefined index: subject in E:\_temp\xampp\htdocs\sxp\insert_into.php on line 7

Notice: Undefined index: author in E:\_temp\xampp\htdocs\sxp\insert_into.php on line 8

Notice: Undefined index: content in E:\_temp\xampp\htdocs\sxp\insert_into.php on line 9

你有重复的帖子可能是造成它的原因。尝试将表单名称更改为其他名称。另外,尝试去除=符号周围的多余空格。

尝试执行
var\u转储($\u POST)。你在
中重复
帖子
,这可能是导致它出错的原因。尝试将表单名称更改为其他名称。另外,试着去掉
=
符号周围的多余空格。PHP和HTML页面是分开的还是同一个页面?你读过吗?@Fred uhhh…是的,这很有效:你没有答案吗?如果你能给我们看一下你的整个流程和表单代码,会有帮助的。问题可能出在您的标题上。@我注意到前面有一个类似的问题,即与
$headers…
重合的额外空格出现故障。很高兴它对你有用。所以你不能命名一个表单
post
?古怪的+1@Jim我会建议“除了”
post
之外的任何东西。PHP的这种方式可能会很糟糕,有些服务器会保留这个词。
Notice: Undefined index: subject in E:\_temp\xampp\htdocs\sxp\insert_into.php on line 7

Notice: Undefined index: author in E:\_temp\xampp\htdocs\sxp\insert_into.php on line 8

Notice: Undefined index: content in E:\_temp\xampp\htdocs\sxp\insert_into.php on line 9