我的主机即将从php 5.2升级到5.4,我有少量的测试时间。除了我主页上的一个联系表格外,我找到了所有作品。在5.2上它发送电子邮件并给出肯定的结果。在5.4,它不发送电子邮件并给用户一个负面结果。对此有任何帮助,非常感谢。
<?php
include_once("includes/includes.inc.php");
if(isset($_POST) && (isset($_POST['contactusfrm']) == 1))
{
#print_arr($_POST);
$quotefrm = array($_POST);
$emailObj = &new eMail();
if(isset($_POST['email']) && $_POST['email']!="")
{
$emailBody = contactUs($quotefrm);
$semail = $quotefrm[0]['email'];
$contactus = $emailInfo->email;
}
$emailInfo = GetContactusEmailInfo();
$subject="Contact Us";
#echo "<br /><br /><br />".$emailBody ; die();
if ($emailObj->SendEmail($semail, $emailInfo->email , $subject , $emailBody, ""))
$contactusMessage = "Your Comments has been sent.";
else
$contactusMessage = "Error sending please re-try.";
}
?>
答案 0 :(得分:1)
这是因为Call-time pass by reference
已从PHP 5.4中删除。
完整列表。请参阅here
。
你正在这一行。
$emailObj = &new eMail(); //which will issue a FATAL Error and your code execution stops here.