WordPress.org

Ready to get started?Download WordPress

Forums

Paid Memberships Pro
[resolved] POSTing data to same page (7 posts)

  1. pmProbeg
    Member
    Posted 2 years ago #

    Hello, I'm hoping there is a simple solution to this issue. I would like to POST back to the same page (checkout page) but I am not receiving the POST data for some reason. I am doing this from checkout.php, which loads into mysite.com/checkout.

    Here is the code I'm using:

    <form action="#" method="POST">
    <input type="submit" name="btn_post_bill_info" value="Go"/>
    </form>

    Also in checkout.php (at the top of page):

    if(isset($_POST['btn_post_bill_info']))
    {
    echo $_POST['btn_post_bill_info'];
    }
    else
    {
    echo "not found";
    }

    I am always getting "not found" meaning the POST is not going to this page.

    Any ideas?

    Thanks in advance!

    http://wordpress.org/extend/plugins/paid-memberships-pro/

  2. strangerstudios
    Member
    Plugin Author

    Posted 2 years ago #

    The $_POST might be getting lost in a redirect.

    A plugin called WP HTTPS is a culprit with this kind of thing when combined with PMPro.

    To troubleshoot these, I try to find any wp_redirect call in PMPro or elsewhere and place a die("AAA") or something above it so I can figure out where the redirect is coming from. Once you find it, you can figure out why the plugin is trying to redirect and fix that.

    If you are submitting to the checkout page, make sure that you include a "level" value (set to the level/membership id) in a hidden field.

  3. pmProbeg
    Member
    Posted 2 years ago #

    Alright, yes I am POSTing to the checkout.php page. So, my form should look like this then?

    checkout.php:
    <form action="#" method="POST">
    <input type="hidden" value="<?$pmpro_level->id?>" />
    <input type="submit" name="btn_post_bill_info" value="Go"/>
    <form>

    Is this what you were trying to explain to me?

    I appreciate your help very much, thanks.

  4. strangerstudios
    Member
    Plugin Author

    Posted 2 years ago #

    You need name="level" in that hidden field.

    You may still have a redirect problem somewhere else, but fix that first.

  5. pmProbeg
    Member
    Posted 2 years ago #

    Thank you. See below :)

  6. pmProbeg
    Member
    Posted 2 years ago #

    The problem was the javascript on the bottom of the page! Wow ... It was disabling all submit buttons.

  7. strangerstudios
    Member
    Plugin Author

    Posted 2 years ago #

    Glad you figured it out.

    PMPro has javascript to disable buttons when they are clicked so people don't click the checkout button twice. Sorry if that was interfering with your code.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic