Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/237.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_Mail Form - Fatal编程技术网

PHP邮件表单未拾取所有字段

PHP邮件表单未拾取所有字段,php,mail-form,Php,Mail Form,我正在尝试制作一个简单的php表单,将信息发送到我的电子邮件 它基本上可以正常工作,只是似乎没有收集到所有的表单信息 我的html是: <form method="post" action="email.php"> Name: <input type="text" name="x" /><br/> Message: <input type="text" name="y" /><br/> <input type="submit"

我正在尝试制作一个简单的php表单,将信息发送到我的电子邮件

它基本上可以正常工作,只是似乎没有收集到所有的表单信息

我的html是:

<form method="post" action="email.php">
Name:  <input type="text" name="x" /><br/>
Message:  <input type="text" name="y" /><br/>
<input type="submit" value="Submit">
</form>    

那就如你所期待的那样。我看不出我对待x和y的方式有什么不同-有人能帮忙吗?谢谢。

如果您将消息行更改为
$message=hello那就行了;真正地我确信你的意思是
$message=“hello”-一定要阅读主题>>>和>>>-我不会花时间调试代码。@Fred ii-如果PHP找不到分配给常量的值,它会将常量显示为字符串。这只会弄乱标题@JamieTaylor-OP需要了解发送邮件的基本原理;不是我的工作。我这么做太久了。@Fred ii-对不起,我不是想纠正你。我指出这就是OP认为它“有效”的原因,谢谢@Fred ii-:行。对实际问题有什么想法吗?
<?php
$name = $_POST["x"];
$subject = "$name says hello";
$message = $_POST["y"];
mail("my@mail.address", $subject, $message);
?>
$message = hello;