Support » Plugins » Hacks » HTML Form within a plugin

  • Resolved rj.alaskan


    I have a (hopefully) quick question. I am trying to get user input from an HTML form within a plugin I am developing.

    For instance, here is a sample ofthe form html that is on the page:

    <form method="post" action="/wp-content/plugins/myplugin/somepage.php" name="somename">

    When the form is submitted, the next page comes up just fine, I have a reCAPTCHA as well and that works fine, but the “somepage.php” does not receive any of the values from the POST form. All of the logic in “somepage.php” functions as built, but there are no values for the POST in the “somepage.php” script.

    My question is, does WordPress require you to use some sort of function for passing values inbetween scripts within functions?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    Nothing special. I get values from POSTed forms using a $_POST['field_name'] type format without issue. But it sounds like you may have some redirect going on that’s dropping the data. You say “the next page comes up just fine” but the values are not in somepage.php. somepage.php should be the next page coming up, that is the action specified in the form. If anything comes up before somepage.php, that is where the fault lies.



    Thanks for the reply, I re-evaluated my code after reading your reply and found the issue. It had nothing to do with WordPress, just like you said.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HTML Form within a plugin’ is closed to new replies.