Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.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_Forms_Contact Form - Fatal编程技术网

Php 邮件联络表格

Php 邮件联络表格,php,html,forms,contact-form,Php,Html,Forms,Contact Form,这个代码有什么问题? 以下是代码的第一页: <strong>Contact Form</strong><form name="form1" method="post" action="sendcontact.php">Subject:<input name="subject" type="text" id="subject" size="50">Detail:<textarea name="detail" cols="50" rows="4"

这个代码有什么问题? 以下是代码的第一页:

<strong>Contact Form</strong><form name="form1" method="post" action="sendcontact.php">Subject:<input name="subject" type="text" id="subject" size="50">Detail:<textarea name="detail" cols="50" rows="4" id="detail"> </textarea>Name:<input name="name" type="text" id="name" size="50">Email:<input name="email" type="text" id="email" size="50"><input type="submit" name="Submit" value="Submit"><input type="reset" name="Submit2" value="Reset">
联系方式主题:详细信息:姓名:电子邮件:
以下是sendcontact.php页面:

<?php $subject =$subject;$message =$detail;$mail_form =$email;$header ="from: $name<$mail_from>";mail("email@email.com",$subject,$message,$header);?>

要检索从POST表单提交的变量,必须从
$\u POST
数组中获取其值

这将实现您的目标:

$subject = $_POST['subject'];
$message = $_POST['detail'];
$mail_from = $_POST['email'];
$header ="from: ".$_POST['name']."<$mail_from>";
mail("email@email.com",$subject,$message,$header);
$subject=$\u POST['subject'];
$message=$_POST['detail'];
$mail_from=$_POST['email'];
$header=“from:”..$\u POST['name']”;
邮件(“email@email.com“,$subject,$message,$header);

请描述您遇到的问题。@zs现在它没有向我发送电子邮件。您在哪里这样做?我是这个网站的新手?