• Resolved gshell

    (@gshell)


    I apologize for asking such a basic question, but I am not sure that I am even on a correct path. I want to create an HTML form to update values in a wp database. I have successfully created a wp database using phpmyadmin. I can access that database and use it’s data to place default values in an HTML form, but I do not understand how I can make the HTML form send those values to an external function. I want to pass the array of variables from the form to a function within a .php file that will execute $wpdb to update the database row information. From what I have seen and read, the action parameter of a form defines a page where the form data is sent as a long string of value pairs. I don’t understand how that can be of any use for what I would like to do.

    What am I missing? I would have thought this type of action would be pretty straightforward process using $wpdb. As I said, I think I may be taking a wrong approach.

    Thanks for any help that you can provide.

Viewing 16 replies (of 16 total)
  • This is an amazing thread! The best, most specific descriptions of form handling fundamentals. However, I’m not as smart, or experienced as either of you in this, so I have two questions, if you have the time.

    1) gshell – you mentioned “I still can not get it to work. Here is what I’ve done:
    I created a new page in WP called action_php.php.
    Did you mean a file? and if so, where did you put it?
    I understand that you added the template php file, and added code to the functions.php, but I don’t know what was in the action_php.php file, or where you would have put it. Am I missing something?

    2) If I’m understanding the organization of elements correctly (and that’s a big “if”), you wouldn’t even need the action command to point to a different URL. It could have been left as action=”” and whatever code was in the mysterious action_php.php could have been added to the template – yes?

    If you’re tired of talking about it, I understand. Either way I got so much out of this. Thanks again!

Viewing 16 replies (of 16 total)
  • The topic ‘Submit Form Data to database’ is closed to new replies.