I've made a custom subscribe form to the newsletter with phpList 3.2.5.
phpList have a default thank you page but I'd like to have a thank you/error message appearing below the imput field like the form in this page (see in the footer): https://www.games-workshop.com
This is my form:
<form method="post" action="http://localhost:8888/cateringross/lists/?p=subscribe" name="subscribeform">
<div class="input-group">
<input type="text" name="email" placeholder="e-mail" value="" maxlength="75" class="form-control"/>
<span class="input-group-btn">
<input type="hidden" name="list[1]" value="signup"/>
<input type="submit" name="subscribe" value="Iscriviti" class="btn btn-large btn-primary"/>
</span>
</div>
</form>
phpList have a subscribelibs2.php file with:
# personalise the thank you page
if ($subscribepagedata['thankyoupage']) {
$thankyoupage = $subscribepagedata['thankyoupage'];
header("Location:../thankyou.php");
} else {
$thankyoupage = '<h3>' . $strThanks . '</h3>' . '<p class="information">' . $strEmailConfirmation . '</p>';
}
$thankyoupage = str_ireplace('[email]', $email, $thankyoupage);
I should prevent the ridirect to the thank you page and validate the email before posting the result on the same page.