我最近在另一个主题上获得了一些帮助,并且能够从我的联系表单中收到一封电子邮件,但是除了消息文本之外的所有信息都被排除在外,并且它是从“Apache”发送的。有什么原因可能会发生这种情况吗?
<?php
if(isset($_POST['submit'])){
$name = $_POST['name'];
$company = $_POST['company'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "______@gmail.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
$to ='______@gmail.com';
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
// display message "We've received your information, thank you"
if($send_contact){
echo "We've received your contact information, thank you";
}
else {
echo "Error, please try again";
} }
?>
<form action = "../mail.php"method="POST">
<p>Name</p> <input type="text" name="name">
<p>Company</p> <input type="text" name="company">
<p>Email</p> <input type="text" name="email">
<p>Phone</p> <input type="text" name="phone">
<p>Message</p><textarea name="message" rows="4" cols="25"></textarea><br />
<input type="submit" value="Submit" name="submit">
</form>