【发布时间】:2015-10-02 12:46:35
【问题描述】:
首先,对于开始另一个问题,我深表歉意,但我对之前帖子 (Some PHP variables not appearing when contact us form is used) 的更新没有得到回复。
我按照上一篇文章中的建议提出了建议,并将文件上传到了我的托管服务提供商。但是,当我尝试提交联系表单时,会出现一个名为“页面保存失败”的新错误。
下面是当前的php代码:
<?php
if(!$_POST) exit;
$to = 'enquiries@mydomain.com'; #Replace your email id...
$name = $_POST['txtname'];
$email = $_POST['txtemail'];
$phone = $_POST['txtphone'];
$comp = $_POST['txtcomp'];
$emp = $_POST['txtemp'];
$move = $_POST['txtmove'];
$comment = $_POST['txtmessage'];
if(get_magic_quotes_gpc()) { $comment = stripslashes($comment); }
$subject = 'Office enquiry from ' . $name . '.';
$msg = "You have been contacted by ".$name."\r\n\n";
$msg .= "You can contact ".$name." via email, ".$email.".\r\n\n";
$msg .= "You can call ".$name." on ".$phone.".\r\n\n";
$msg .= "$name has ".$emp." employees and the company name is ."$comp.".\r\n\n";
$msg .= $name." would like to move in on ."$move.".\r\n\n";
$msg .= $comment."\r\n\n";
$msg .= "---------------------------------------------------------------\r\n";
if(@mail($to, $subject, $msg, "From: $email\r\nReturn-Path: $email\r\n"))
{
echo "<span class='success-msg'>Thanks for Contacting Us, We have received your query and will be in touch soon.</span>";
}
else
{
echo "<span class='error-msg'>Sorry your message was not sent, Please try again or contact us via live chat.</span>";
}
?>
再次很抱歉提出一个新问题,但我会很感激任何帮助。
【问题讨论】: