未收到PHP输入字段。花了2天时间-可以';解决不了

未收到PHP输入字段。花了2天时间-可以';解决不了,php,forms,Php,Forms,我认为对于熟悉PHP的人来说,这是一个简单的解决方案。我已经找了两天的答案了。虽然信息量很大,但没有一个能解决问题。请参阅下面的第三部分–我收到的表格中没有字段信息。 我做错了什么 请注意,表单本身被包装在标记中,这些标记不会出现在下面 表格如下: <form name="Seller" id="restaurant-fm" action="send2.php" method="POST" enctype="text/plain"> <input type="text"

我认为对于熟悉PHP的人来说,这是一个简单的解决方案。我已经找了两天的答案了。虽然信息量很大,但没有一个能解决问题。请参阅下面的第三部分–我收到的表格中没有字段信息。 我做错了什么

请注意,表单本身被包装在
标记中,这些标记不会出现在下面

表格如下:

<form name="Seller" id="restaurant-fm" action="send2.php"  method="POST" enctype="text/plain">  
<input type="text" name="name" required="required" id="name" size="25"       
 value="" placeholder="Your name" autocomplete="on" tabindex="1"          

class="txtinput">
<input type="email" name="email" required="required" id="email" size="25" value="" placeholder="Your e-mail address" autocomplete="on" tabindex="2"        
class="txtinput">       
<input type="tel" name="phone" id="phone" placeholder="Your phone number" tabindex="3" size="12" value="" class="txtinput">
<textarea name="message" id="inquiry" placeholder="(Optional) Enter message here..." tabindex="4" class="txtblock"></textarea> 

<section id="buttons">
<input type="submit" name="submit" id="submitbtn" class="submitbtn" tabindex="6" value="CLICK TO GET STARTED">
<br style="clear:both;">
</section>
</form>
A visitor sent you the following information: 

name:; 

email:; 

phone:; 

message:; 

您可以尝试删除
value=”“
,也可以删除消息字符串中变量后的所有分号,例如更改
$name
只需
$name

确保调用的名称字段与正在收集的
POST
变量相同(当前似乎正在发送名称,但脚本正在查找名称1)

当脚本中的变量到达时,您能否
回显它们


在大多数服务器上,您需要在服务器上创建“发件人”域,并在表单中为电子邮件地址添加“replyto”。请记住清理输入数据以避免脚本攻击。

首先,需要从表单标记中删除
enctype=“text/plain”

阅读以下关于它的问答;更具描述性:


然后使用
Where is
form
opening标记?首先去掉
enctype=“text/plain”
,这是主要原因。您没有
name1
name属性,您有
name
。检查错误。请立即回复此查询?粗鲁的通过var_dump($_POST)调试代码;然后从那个里开始。那个
{…}
是怎么回事?谢谢你们的回复。我现在转到链接。请不要使用答案来询问澄清问题。您的编辑越来越近,但您遗漏了一些内容。实际上有一些。
A visitor sent you the following information: 

name:; 

email:; 

phone:; 

message:; 
$headers = "From: $email";
mail($to,$subject,$message,$headers);
{mail($to,$subject,$message);
header("Location:/About.html");}
if(mail($to,$subject,$message,$headers)){
    header("Location:/About.html");
    exit;
    }

else{
    echo "Mail failed. Check your logs";
    }
mail($to,$subject,$message);
    header("Location:/About.html");
    exit;
<?php 
error_reporting(E_ALL);
ini_set('display_errors', 1);

// rest of your code