我有一个简单的联系表单,客户将把他们的推荐,尽管提交表单时,我将它带到流程页面,这是很好的原因,谢谢你的页面实现了。但提交后,它只是带我到页面的页面,而不是感谢页面。我无法找到问题,可以使用一些帮助,从你们窗体只输出错误
形式:
<form action="includes/mail.php" method="post">
<table background="images/sequestrationreferral.jpg" height="408px" width="740px">
<tr>
<td width="80px" height="50px"><label>Name:</label></td>
<td><input class="input" type="text" name="name" width="225px" /></td>
</tr>
<tr>
<td width="80px" height="50px"><label>Email Address:</label></td>
<td><input class="input" type="text" name="email" width="225px" /></td>
</tr>
<tr>
<td width="80px" height="120px"><label>Referals:</label></td>
<td><textarea class="input" name="referals" cols="35" rows="5"></textarea><br /><br />Please use one per row?</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Send referals" class="btn" /></td>
</table>
</form>
进程页:
<?
/* Edit these preferences to suit your needs */
$mailto = '[email protected]'; // insert the email address you want the form sent to
$returnpage = '../thanks.php'; // insert the name of the page/location you want the user to be returned to
$sitename = '[Loanro]'; // insert the site name here, it will appear in the subject of your email
/* Do not edit below this line unless you know what you're doing */
$name = $_POST['name'];
$email = $_POST['email'] ;
$referals = stripslashes($_POST['referals']);
if (!$name) {
print("<strong>Error:</strong> Please provide your name.<br/><br/><a href='javascript:history.go(-1)'>Back</a>");
exit;
}
if (!$email) {
print("<strong>Error:</strong> Please provide an email address.<br/><br/><a href='javascript:history.go(-1)'>Back</a>");
exit;
}
if (!$referals) {
print("<strong>Error:</strong> Please provide your enquiry details.<br/><br/><a href='javascript:history.go(-1)'>Back</a>");
exit;
}
if (!eregi("^[a-z0-9]+([-_\.]?[a-z0-9])[email protected][a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email)){
print("<strong>Error:</strong> this email address is not in a valid format.<br/><br/><a href='javascript:history.go(-1)'>Back</a>");
exit;
}
$message = "\n$name submitted the following message:\n\n$enquiry\n\nTheir contact details are as follows:\n\nName: $name\nEmail Address: $email\n\n";
mail($mailto, "$sitename Referal from $name", $message, "From: $email");
header("Location: " . $returnpage);
?>
而且谢谢页:
<article class="art-post art-article">
<div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout layout-item-0">
<div class="art-content-layout-row">
</div>
</div>
<div class="art-content-layout-wrapper layout-item-4">
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell layout-item-5" style="width: 75%" >
<p>Thank you for contacting up, we will get back to you as soon as possible.</p>
</div>
</div>
</div>
</div>
</div>
</article>
尝试包围“ob_end_clean();”之前“标题()” – tinybyte
我认为这个问题是因为在进程页面有问题,你在进程页面中得到了什么错误? – ncm
如果是输出错误,似乎没有显示谢谢页面......但是你不应该在头部之前显示任何东西 – Brewal