我有一个简单的联系表格,客户将在其中放置他们的推荐信,尽管在提交表格后它会将我带到流程页面,这很好,因为执行了感谢页面。但在提交后,它只会将我带到 posses 页面,而不是感谢页面。我找不到问题,可以向你们寻求帮助
表格:
<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 = 'marketing@loanro.co.za'; // 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])+@[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>