1

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.

  • if you have "php" code, you should post it in the question, rather than having people visit your site. Parsed PHP shows up as HTML, not "source". – Funk Forty Niner Aug 03 '16 at 12:26
  • 1
    Use jQuery ajax to submit your form and show the message in the same page where ever you want... Click [here](http://www.w3schools.com/jquery/ajax_ajax.asp) to see the demo –  Aug 03 '16 at 12:31
  • @Artemis - I deleted my answer since I was unable to provide you with a solution. It seems that ajax may be the answer here, and will apparently require a lot more code and TBH, am not the best with ajax. – Funk Forty Niner Aug 03 '16 at 13:27

0 Answers0