将用户表单输入放入php变量并发送邮件

将用户表单输入放入php变量并发送邮件,php,forms,variables,user-input,Php,Forms,Variables,User Input,我想向用户发送他们提交的联系表单的副本。我有以下php代码: $formproc->AddRecipient('webmaster@somewhere.com'); 这个前端代码: <form id='contactsensei' action='<?php echo $formproc->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'> <fieldset> <inpu

我想向用户发送他们提交的联系表单的副本。我有以下php代码:

$formproc->AddRecipient('webmaster@somewhere.com');
这个前端代码:

<form id='contactsensei' action='<?php echo $formproc->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'>
<fieldset>

<input type='hidden' name='submitted' id='submitted' value='1'/>
<input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/>
<input type='text'  class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' />

<div class='container'>
    <label for='email' >*E-mail:</label><br/>
    <input type='text' name='email' id='email' value='<?php echo $formproc->SafeDisplay('email') ?>' maxlength="50" /><br/>
    <span id='contactsensei_email_errorloc' class='error'></span>
</div>
这显然不起作用。没什么帮助。谢谢

==

呃,我想我修正了它,因为它能工作,但显然它会出错。我现在有了

$uemail = $_POST['email'];
$formproc->AddRecipient('webmaster@somewhere.com'); //<<---Put your email address here
$formproc->AddRecipient($uemail);
同样有效,但我得到了一个错误: 注意:未定义索引:第19行C:\wamp64\www\scripts\contact\contactus.php中的电子邮件


这是我以前没见过的。我的函数来自一个定制的fgcontactform.php,如果这很重要的话。它要求我定义什么/在哪里

如果要从post添加,请尝试以下操作:

$uemail = $_POST['uemail'];
$formproc->AddRecipient($uemail);

每个参数以逗号分隔。如果uemail不是定义的单词,则需要使用$\u POST['uemail'],并且需要使用如下引号:

$uemail = $_POST['uemail'];
if(isset($uemail))
{
$formproc->AddRecipient($uemail);
}
uemail被识别为约束, 要访问$\u POST数组,必须将一个键指定为字符串,并且该键必须与输入名称属性相同,因此请重试

$uemail = $_POST['email'];
最后将该变量传递给AddRecipient方法:

$formproc->AddRecipient($uemail);

$formproc->AddRecipient'$uemail','$username';这也可以帮助您$uemail=$_POST['uemail'];现在工作。谢谢有没有办法组合这两行代码$formproc->AddRecipient'webmaster@rovingaikido.com'; $formproc->AddRecipient$uemail;
$formproc->AddRecipient($uemail);