WordPress.org

Forums

WP Email Capture
[resolved] Error message not displayed on email-form (6 posts)

  1. Paul_Z
    Member
    Posted 2 years ago #

    After submitting the form on my signup page (did not provide a name or mailadress) an error is raised (that's ok!) but the error is passed to the wrong url:

    http://www.mysite.com/?wp_email_capture_error=Please%20Provide%20A%20Name

    instead of http://www.mysite.com/signuppage/?wp_email_capture_error=Please%20Provide%20A%20Name

    http://wordpress.org/extend/plugins/wp-email-capture/

  2. Rhys Wynne
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Paul,

    This should've been fixed in the previous version. Odd. Will look into it again.

    Cheers

    Rhys

  3. Rhys Wynne
    Member
    Plugin Author

    Posted 2 years ago #

    Fixed this (or will fix this) - just putting some finishing touches to v2.7.1. Will be released soon :)

  4. mleuffer
    Member
    Posted 2 years ago #

    Hi Rhys,
    I have the same issue on a local Mamp install with this result:
    http://localhost/folder/subfolder/?wp_email_capture_error=Please%20Provide%20A%20Name
    The two folders are real, not url rewrited.
    The form is placed on the page news (first level page)
    which has a url like this:
    http://localhost/folder/subfolder/news/
    so it should be like this:
    http://localhost/folder/subfolder/news/?wp_email_capture_error=Please%20Provide%20A%20Name

    Thanks for the work on this plugin though, it's nice and clean :)
    Cheers,
    Mik

  5. mleuffer
    Member
    Posted 2 years ago #

    Ok it seems the HTTP_REFERER don't show at all in my firefox 19.0 (OSX 10.6.8). It works fine in Chrome. It had nothing to do with the /folder/subfolder/ thing in the url, nor MAMP as I thought... (I tried on a server too).

  6. mleuffer
    Member
    Posted 2 years ago #

    I made a solution.
    Tell me if you think it's clean.

    I add a hidden input with the id in the form
    <input type="hidden" name="wp_page_id" value="<?php the_ID(); ?>" />
    (display.php line 27)

    And use the permalink in place of $_SERVER['HTTP_REFERER'];
    (process.php line 52)

    if(isset($_REQUEST['wp_page_id'])) {
    	$starturl = get_permalink( $_REQUEST['wp_page_id'] );
    }

    It's working fine on pages. It didn't on my articles pages but it was because of a loop context in my template file not scoped on page so you just have to save the $post context before the loop showing articles and restore it then.

    <?php $tmp_post = $post; // save page context
    // your loop on articles
    $post = $tmp_post; // restore page context ?>
    // your sidebar call

    Hope it can help some over people in the same case.
    Cheers,
    Mik

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Email Capture
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic