• OK I have limited knowledge of PHP and how WordPress works internally so I will try and explain what I am trying to do as best as I can without sounding totally stupid.

    I am trying to pass data from one WordPress page (landing page) to another (order form using the eStore plugin) and filling in the custom_input form on the Order page using the values passed from the previous page.

    I have just setup a test form on the landing page using the following code:

    <form action=”/order-form/” method=”post”><input name=”custom_input” type=”text” />
    <input type=”submit” name=”submit” value=”submit”>

    Now from my understand I need to process that POST data using PHP so I modified my plugin slightly and added:

    $customInput = $_POST[‘custom_input’];

    <input type=”text” name=”custom_input” value=”‘ . $customInput . ‘” class=”eStore_text_input eStore_collect_input” />

    There’s obviously more code to it but they are the important parts.

    Nothing happens when I try this out. No errors occur so I am presuming nothing is wrong with my code but I am guessing it’s something to do with how WordPress processes POST data. Is there an ‘easy’ work around for this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jwhittam

    (@jwhittam)

    OK I turned error reporting on and it gave this error.

    Notice: Undefined variable: customInput

    this error occurs just above the form – not at the top of the screen. I am assuming because I have the _GET request within the plugin file (which is only called from a shortcode) it won’t process the header. How can I get the plugin to fetch this data?

    Hi Jwhittam,

    The $_POST variable in PHP contains content that has been submitted, not content to submit. You would need to have the Submit button, allow the user to input text, and then have the page at /order-form/ do something with the submitted $_POST variable you’re talking about.

    I hope that helps.

    -Aram

    Thread Starter jwhittam

    (@jwhittam)

    Hi Aram,

    I sorted it. I declared the post data as a variable within a function on the plugin and it worked great.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Processing _POST data’ is closed to new replies.