我正在尝试从我的网站上的联系表单发送邮件,当它成功发送时我想显示成功消息,但成功消息始终显示,是什么解决了这个问题?
<?php
$bussiness = $_POST['contact[Business Name]'];
$ownername = $_POST['ownername'];
$buyername = $_POST['buyername'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$yib = $_POST['yib'];
$nroe = $_POST['nroe'];
$nol = $_POST['nol'];
$taxid = $_POST['taxid'];
$resalelicense = $_POST['resalelicense'];
$productlines = $_POST['productlines'];
$retailerlist = $_POST['retailerlist'];
$formcontent=" From: $bussiness \n OwnerName: $ownername \n Buyer name: $buyername \n Address: $address \n City: $city \n State: $state \n Zip Code: $zipcode \n Phone: $phone \n Email: $email \n Years in bussiness: $yib \n Number of employees : $nroe \n Number of locations: $nol \n Tax ID: $taxid \n Resale license : $resalelicense \n Product lines: $productlines \n Retailer list: $retailerlist ";
$recipient = "agonramizi@gmail.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
if(mail($recipient, $subject, $formcontent, $mailheader)) {
echo "Thank you, your message has been recieved!";
}else {
echo "Sorry, there was an error sending your message!";
}
?>
我的html在下面,我想修复它以便它只在发送电子邮件后显示该消息,这是我的网站http://hip-products.rogsiteworks.com/contact.php
谢谢