我有一個簡單的聯繫表單,客戶將把他們的推薦,儘管提交表單時,我將它帶到流程頁面,這是很好的原因,謝謝你的頁面實現了。但提交後,它只是帶我到頁面的頁面,而不是感謝頁面。我無法找到問題,可以使用一些幫助,從你們窗體只輸出錯誤
形式:
<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