WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Paid Memberships Pro] POSTing data to same page

[Resolved] [Plugin: Paid Memberships Pro] POSTing data to same page

  • 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/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jason Coleman
    Participant

    @strangerstudios

    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.

    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.

    Plugin Author Jason Coleman
    Participant

    @strangerstudios

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

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

    Thank you. See below 🙂

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

    Plugin Author Jason Coleman
    Participant

    @strangerstudios

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] [Plugin: Paid Memberships Pro] POSTing data to same page’ is closed to new replies.