我通过 PHP 表单电子邮件收到空白变量


I am receiving blank variables via PHP form email

我在电子邮件中收到这个。 我每天收到一些,但无法尝试联系我的潜在客户。 我测试了页面,它们似乎总是有效。 如果我将表单保留为空白条目,则在进行测试时会出错。 我希望能够解决这个问题,因为我觉得我正在失去潜在的销售线索。

电子邮件是空白的,如下所示:

主题::

电子邮件::

替代电子邮件::

消息::


<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
mail("myemail@sample.com","PhpFormGenerator - Contact from Website","Form data:
Subject:: " . $_POST['field_1'] . " 
Email:: " . $_POST['field_2'] . " 
Alt Email:: " . $_POST['field_3'] . "
Message:: " . $_POST['field_4'] .
");
include("confirm.html");
?>

<BR/><!-- begin form -->
<form method=post enctype=multipart/form-data action=processor.php onSubmit="return validatePage1();"><ul class=mainForm id="mainForm_1">
<li class="mainForm" id="fieldBox_1">
<label class="formFieldQuestion" style="font-size: medium">
Sudject:&nbsp;*</label><select class=auto-style13 name=field_1 id=field_1 style="width: 415px; height: 24px"><option value=''></option>
<option>Sales</option>
<option>Product Questions</option>
<option>Payment Quesitons</option>
<option>Shipping Questions</option>
<option>Support</option>
<option>Other (Not Listed)</option>
</select></li>
<li class="mainForm" id="fieldBox_2">
<label class="formFieldQuestion" style="font-size: medium">Email:&nbsp;*</label><input class=auto-style20 type=email name=field_2 id=field_2 size=20 value="" style="background-image:url('dolls/inflatable/order/imgs/email.png'); background-repeat: no-repeat;  padding: 2px 2px 2px 25px; width: 385px; height: 24px;"><label class="formFieldQuestion" style="font-size: medium; width: 228px;">Alt. Email 
or Re-Enter Email:&nbsp;*</label></li>
<li class="mainForm" id="fieldBox_3">
<input class=auto-style20 type=email name=field_3 id=field_3 size=20 value="" style="background-image:url('dolls/inflatable/order/imgs/email.png'); background-repeat: no-repeat;  padding: 2px 2px 2px 25px; width: 385px; height: 24px;"></li>
<li class="mainForm" id="fieldBox_5">
</li>
<li class="mainForm" id="fieldBox_4">
<label class="formFieldQuestion" style="font-size: medium">
Message:&nbsp;*</label></li><textarea class=mainForm  name=field_4 id=field_5 cols=20 style="width: 400px; height: 85px; background: #FFFFFF; color: #000000"></textarea>

<!-- end of this page -->
<!-- page validation -->
<SCRIPT type=text/javascript>
<!--
function validatePage1()
{
retVal = true;
if (validateField('field_1','fieldBox_1','text',1) == false)
retVal=false;
if (validateField('field_2','fieldBox_2','text',1) == false)
retVal=false;
if (validateField('field_3','fieldBox_3','text',1) == false)
retVal=false;
if(retVal == false)
{
alert('Please correct the errors. Fields marked with an asterisk (*)');
return false;
}
return retVal;
}
//-->
</SCRIPT>
<!-- end page validaton -->

<!-- next page buttons -->
<li class="mainForm">
<input id="saveForm" class="auto-style6" type="submit" value="Submit" style="height: 47px; color: #000000; background-color: #CCCCCC; font-size: medium; border: #000000; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-weight: bold; font-size: 100%; font-variant: normal; line-height: normal; width: 277px;" />
</li>
</ul>
</form>
<!-- end of form -->
<!-- close the display stuff for this page -->

我是新手,并使用phpformgenerator来创建此页面。 我真正关心的是获取客户的电子邮件地址。

任何帮助将不胜感激。

谢谢

我想

发表评论而不是发布一个 anwser,但我没有足够的代表。

我真的怀疑你正在失去销售。这可能是一个没有JS的机器人提交,因此该部分被忽略。

它也可能是废弃处理器.php文件名的机器人,现在他们直接访问该表单。你可以输入:

if(isset($_POST["field_2"]))

该页面顶部的测试类型。然后,您可以记录机器人是否直接连接到该页面。