我为客户制作了一个网页,其中包含一系列文本框,要求提供特定信息,例如人名、电子邮件地址、公司等。以及一个将信息通过电子邮件发送给我的客户的按钮。每当我测试该按钮时,它似乎工作得很好,我上传了页面并认为我已经完成了。但是,前几天我的客户从该网站收到了这封电子邮件:
名称:rfhopzdgmx rfhopzdgmx
电子邮件:envlxw@lnlnsm.com
公司:zUDXatAfoDvQrdH
邮寄地址:
AaSsXklqpHIsoCNcei
gXsimMPRBYZqq
vGLvZraZNdpOAV, ChsmuibE PoKzaSCubXPRI
家庭电话:CIJbIfjMfjIaTqAlD
工作电话:JFLZBOvru
手机:XlFJTTFGiTTiiFQfy
传真:UEJMOVZodWPkKxew
评论:sPvSCE hgettwoguderu,*
[url=http://atyktjlxcznl.com/]atyktjlxcznl[/url],
[link=http://nudvfcehwpyg.com/]nudvfcehwpyg[/link], http://lvvwkbzbhnzp.com/
注意:* 行包含 HTML 链接代码,我只是不知道如何让这个网站显示它。
这是站点中用于电子邮件按钮的 PHP 代码。
<?php
//This Sends A Formatted Text Email Using The Text Boxes
if ($_POST['submit']){
//This Gets The Form Data
$fname = $_POST['fName'];
$lname = $_POST['lName'];
$email = $_POST['email'];
$company = $_POST['co'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$homep = $_POST['homeP'];
$workp = $_POST['workP'];
$cellp = $_POST['cellP'];
$fax = $_POST['fax'];
$comments = $_POST['txaOutputField'];
//echo "<script language = 'javascript'>alert('YAY');</script>";
if ($fname && $lname && $email && $comments){ //Check If Required Fields Are Filled
//This Sets The SMTP Configuration In php.ini
ini_set("SMTP", "smtp.2ndsourcewire.com");
//This Replaces Any Blank Fields With 'None's
if ($company == ""){
$company = "None";
}
if ($address1 == ""){
$address1 = "None";
}
if ($city == ""){
$city = "None";
}
if ($state == ""){
$state = "None";
}
if ($zip == ""){
$zip = "None";
}
if ($homep == ""){
$homep = "None";
}
if ($workp == ""){
$workp = "None";
}
if ($cellp == ""){
$cellp = "None";
}
if ($fax == ""){
$fax = "None";
}
//This Creates The Variables Necessary For The Email
$to = "CLIENT EMAIL WHICH I'M CENSORING";
$subject = "Email from 2ndSourceWire.com";
$from = "From: noreply@2ndsourcewire.com";
$secondEmail = "MY EMAIL WHICH I'M ALSO CENSORING";
if ($address2 == ""){
$body = "Name: $fname $lname\n".
"Email: $email\n".
"Company: $company\n\n".
"Mailing Address:\n".
"$address1\n".
"$city, $state $zip\n\n".
"Home Phone: $homep\n".
"Work Phone: $workp\n".
"Cell Phone: $cellp\n".
"Fax: $fax\n\n".
"Comments:\n".
"$comments";
}
else {
$body = "Name: $fname $lname\n".
"Email: $email\n".
"Company: $company\n\n".
"Mailing Address:\n".
"$address1\n".
"$address2\n".
"$city, $state $zip\n\n".
"Home Phone: $homep\n".
"Work Phone: $workp\n".
"Cell Phone: $cellp\n".
"Fax: $fax\n\n".
"Comments:\n".
"$comments";
}
//This Sends The Email
mail($to, $subject, $body, $from);
mail($secondEmail, $subject, $body, $from);
echo "<script language = 'javascript'>alert('The email was sent successfully.');</script>";
}
else {
//The Required Fields Are Not Filled
echo "<script language = 'javascript'>alert('Please fill your first name, last name, email address, and your comment or question.');</script>";
}
}
?>
我对这是怎么发生的有点傻眼,客户提到了几封电子邮件,所以我不认为这是一个随机故障。此外,电子邮件地址的格式类似于电子邮件地址,因此有人或某个程序正在解释每个文本框旁边的标签。我还注意到输入的名字和姓氏是同一个词,即使它们在不同的文本框中,我认为它是一些垃圾邮件程序,但他们不会尝试做广告和赚钱,而不仅仅是喷随机文本?此外,评论部分对我来说毫无意义,链接无处可去,而且它们的格式都很完美,随便乱搞的人不会知道这些标签,而这样做的程序员也不会打扰它,但程序也不会。
我不知道是什么原因造成的或如何解决它,我在这里画一个空白。有人有想法么?